Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Automated migration from JBoss AMQ 6 to Red Hat AMQ 7 on Red Hat OpenShift

<p>&nbsp;</p> <quillbot-extension-portal></quillbot-extension-portal>

May 1, 2019
Roman Martin Gil
Related topics:
LinuxKubernetes
Related products:
Streams for Apache KafkaRed Hat OpenShiftRed Hat OpenShift Container Platform

    Since Red Hat OpenShift Container Platform was first released, Red Hat Middleware products were provided to deploy on it and help developers to build more complex solutions. Messaging Brokers are a very important piece in most new application architectures, such as microservices, event sourcing, and CQRS. Red Hat JBoss AMQ was provided from the beginning to deploy Messaging Brokers on Red Hat OpenShift easily.

    Red Hat AMQ 7 is the latest version of a high-performance, scalable, and multi-protocol broker based on the Apache ActiveMQ Artemis open source project. It is also available as a containerized image for use with Red Hat OpenShift, so it allows developers to quickly deploy messaging brokers in a cloud environment.

    There is a Red Hat AMQ 7 migration guide with the most important topics; however, how to do this on Red Hat OpenShift is not completely covered. From my field experience with customers, we defined an automated process to do it on OpenShift including:

    • Zero downtime for consumers and producers
    • Move any persisted message from Red Hat JBoss AMQ 6 to Red Hat AMQ 7
    • Automated using Ansible Playbooks

    Migration Process

    Red Hat JBoss AMQ 6 (AMQ 6) provides a drainer pod, only available for persistent templates, which is responsible for managing the migration of messages. When AMQ 6 is deployed using a multi-node configuration, it is possible for messages to be left in the KahaDB store directory when the AMQ 6 cluster is scaled down. To prevent messages from remaining, the drainer pod will recover them and move them to other AMQ 6 pod instance. Behind the scenes, a network of brokers is established between the drainer pod and other AMQ 6 pods.

    Red Hat AMQ 7 provides the same protocols that previous version. The drainer pod uses OpenWire protocol to move messages, so we will use it to move messages to the new Red Hat AMQ 7 broker.

    We need to change the service selectors of each AMQ 6 protocol service (openwire, amqp, stomp, mqtt) to identify the new Red Hat AMQ 7 pod instances. When an AMQ 6 broker is scaled down (replicas = 0), the drainer pod will move the persisted messages.

    This feature defines a very straight forward migration process as:

    1. Scale up Red Hat AMQ 7 broker and wait to be ready.
    2. Patch AMQ 6 services to balance connections to Red Hat AMQ 7 broker pods.
    3. Scale down AMQ 6 drainer (it will be started later).
    4. Scale down AMQ 6 broker to avoid new connections. New connections are established to new Red Hat AMQ 7 broker.
    5. Scale up AMQ 6 drainer to drain messages to new Red Hat AMQ 7 broker.
    6. Check AMQ 6 drainer concluded two migration cycles. If after two cycles there are not messages to migrate, we can confirm that drainer finished successfully.
    7. Scale down AMQ 6 drainer.

    Ansible Playbook

    The migration process described above includes steps and checks, which are very easy to execute manually. However, it could be more difficult if you need to do this for each AMQ 6 broker deployed in Red Hat OpenShift. Ansible playbooks and Ansible roles can help you automate it easily.

    I developed a simple Ansible playbook to migrate brokers using command module and OpenShift CLI. Of course, there are other alternatives to implement other approaches, such as, oc module, openshift_raw module, openshift module, etc.

    This Ansible playbook sample is available in this GitHub repository.

    Conclusions

    This article shows how easy it is to migrate Red Hat JBoss AMQ 6 brokers to Red Hat AMQ 7 brokers on Red Hat OpenShift. Do not miss the opportunity to get the best improvements of Red Hat AMQ 7 in your Red Hat OpenShift deployments.

    Last updated: June 30, 2023

    Recent Posts

    • Preventing GPU waste: A guide to JIT checkpointing with Kubeflow Trainer on OpenShift AI

    • How to manage TLS certificates used by OpenShift GitOps operator

    • Configure a split disk on OpenShift Container Platform

    • Red Hat Enterprise Linux 10.2 and 9.8: Top features for developers

    • What GPU kernels mean for your distributed inference

    What’s up next?

     

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.