Skip to main content
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 Red Hat 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

    • Red Hat OpenShift AI
    • 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.

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

    • 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.

ConsoleDocsSupport Search
New For you

Recommended

We'll recommend resources you may like as you browse. Try these suggestions for now.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

How to start multiple Artemis brokers inside Red Hat JBoss EAP-7 container in Master/Slave fashion

October 19, 2017
Avadhut Lele
Related products:
Red Hat JBoss Enterprise Application Platform

    To be as simple as possible, we will walk through a stand-alone use-case.

    Usually, when we require having messaging features in our stand-alone environment, we use full profile for EAP container.

    If we have a requirement with clustering functionalities then we prefer to have HA profile but if clustering and messaging both are required then we go for a full-HA profile.

    By default with a full/full-HA profile, EAP-7 container provides us the default configuration for the embedded Artemis Broker with default configuration. But, in certain scenarios, people might have a requirement for the additional broker inside the same EAP-7 container. In such cases, I recommend having separate connector mapping for additional Artemis Broker.

    First, create the socket-binding entry inside the socket-binding-group for an additional Artemis broker:

    <socket-binding name="http-2" port="${jboss.http.port:8180}" />

    Here, I am creating http-2 as socket-binding for additional Artemis. Artemis uses http port 8080 for communication by default. However, it will be occupied when we will start our EAP-7 server hence to avoid conflict, I added an additional socket for the second instance of Artemis in a container.

    Next, is to rename the existing default Artemis server/broker to identify between multiple instances. I am trying to set up master-slave topology and hence I am setting up server name as 'master'.

    <server name="master">

    Then I copy the same server and pasted inside messaging subsystem with a name as a backup.

    <server name="backup">
    
    <security-setting name="#">
    
    <role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
    
    </security-setting>
    
    <address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/>
    
    <http-connector name="http-connector-2" socket-binding="http-2" endpoint="http-acceptor-2"/>
    
    <http-connector name="http-connector-throughput-2" socket-binding="http" endpoint="http-acceptor-throughput-2">
    
    <param name="batch-delay" value="50"/>
    
    </http-connector>
    
    <in-vm-connector name="in-vm" server-id="1"/>
    
    <http-acceptor name="http-acceptor-2" http-listener="default"/>
    
    <http-acceptor name="http-acceptor-throughput-2" http-listener="default">
    
    <param name="batch-delay" value="50"/>
    
    <param name="direct-deliver" value="false"/>
    
    </http-acceptor>
    
    <in-vm-acceptor name="in-vm" server-id="1"/>
    
    <jms-queue name="ExpiryQueue-2" entries="java:/jms/queue/ExpiryQueue-2"/>
    
    <jms-queue name="DLQ-2" entries="java:/jms/queue/DLQ-2"/>
    
    <connection-factory name="InVmConnectionFactory-2" connectors="in-vm" entries="java:/ConnectionFactory-2"/>
    
    <connection-factory name="RemoteConnectionFactory-2" connectors="http-connector-2" entries="java:jboss/exported/jms/RemoteConnectionFactory-2"/>
    
    <pooled-connection-factory name="activemq-ra-2" transaction="xa" connectors="in-vm" entries="java:/JmsXA-2 java:jboss/DefaultJMSConnectionFactory-2"/>
    
    </server>

    After this step, I thought to have a master and execute below command to make both the brokers in master-slave fashion:

    $ /subsystem=messaging-activemq/server=master/ha-policy=shared-store-master:add(failover-on-server-shutdown=true)
    
    $ /subsystem=messaging-activemq/server=backup/ha-policy=shared-store-slave:add(allow-failback=true,restart-backup=true,failover-on-server-shutdown=true)

    The entire configuration of the messaging subsystem is as below:

    <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
     <server name="master">
     <shared-store-master failover-on-server-shutdown="true"/>
     <security-setting name="#">
     <role name="guest" delete-non-durable-queue="true" create-non-durable-queue="true" consume="true" send="true"/>
     </security-setting>
     <address-setting name="#" message-counter-history-day-limit="10" page-size-bytes="2097152" max-size-bytes="10485760" expiry-address="jms.queue.ExpiryQueue" dead-letter-address="jms.queue.DLQ"/>
     <http-connector name="http-connector" endpoint="http-acceptor" socket-binding="http"/>
     <http-connector name="http-connector-throughput" endpoint="http-acceptor-throughput" socket-binding="http">
     <param name="batch-delay" value="50"/>
     </http-connector>
     <in-vm-connector name="in-vm" server-id="0"/>
     <http-acceptor name="http-acceptor" http-listener="default"/>
     <http-acceptor name="http-acceptor-throughput" http-listener="default">
     <param name="batch-delay" value="50"/>
     <param name="direct-deliver" value="false"/>
     </http-acceptor>
     <in-vm-acceptor name="in-vm" server-id="0"/>
     <jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
     <jms-queue name="myQueue" entries="java:/jms/queue/myQueue"/>
     <jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
     <connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
     <connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="http-connector"/>
     <pooled-connection-factory name="activemq-ra" transaction="xa" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm"/>
     </server>
     <server name="backup">
     <shared-store-slave failover-on-server-shutdown="true"/>
     <security-setting name="#">
     <role name="guest" delete-non-durable-queue="true" create-non-durable-queue="true" consume="true" send="true"/>
     </security-setting>
     <address-setting name="#" message-counter-history-day-limit="10" page-size-bytes="2097152" max-size-bytes="10485760" expiry-address="jms.queue.ExpiryQueue" dead-letter-address="jms.queue.DLQ"/>
     <http-connector name="http-connector-2" endpoint="http-acceptor-2" socket-binding="http-2"/>
     <http-connector name="http-connector-throughput-2" endpoint="http-acceptor-throughput-2" socket-binding="http-2">
     <param name="batch-delay" value="50"/>
     </http-connector>
     <in-vm-connector name="in-vm" server-id="1"/>
     <http-acceptor name="http-acceptor-2" http-listener="default"/>
     <http-acceptor name="http-acceptor-throughput-2" http-listener="default">
     <param name="batch-delay" value="50"/>
     <param name="direct-deliver" value="false"/>
     </http-acceptor>
     <in-vm-acceptor name="in-vm" server-id="1"/>
     <jms-queue name="ExpiryQueue-2" entries="java:/jms/queue/ExpiryQueue-2"/>
     <jms-queue name="myQueue" entries="java:/jms/queue/myQueue2"/>
     <jms-queue name="DLQ-2" entries="java:/jms/queue/DLQ-2"/>
     <connection-factory name="InVmConnectionFactory-2" entries="java:/ConnectionFactory-2" connectors="in-vm"/>
     <connection-factory name="RemoteConnectionFactory-2" entries="java:jboss/exported/jms/RemoteConnectionFactory-2" connectors="http-connector-2"/>
     <pooled-connection-factory name="activemq-ra-2" transaction="xa" entries="java:/JmsXA-2 java:jboss/DefaultJMSConnectionFactory-2" connectors="in-vm"/>
     </server>
     </subsystem>

    Save the configuration file and start the Red Hat JBoss EAP-7 server.


    Click here and quickly get started with the JBoss EAP download.

    Last updated: October 17, 2017

    Recent Posts

    • A day in the life of an NVIDIA H100 on Red Hat OpenShift 5

    • Migrate BuildConfigs to builds for Red Hat OpenShift with one plug-in install

    • Run Red Hat Enterprise Linux CoreOS on NVIDIA BlueField DPUs

    • Agent harness engineering: Separating model capabilities from enforcement

    • What's new for developers in Red Hat Enterprise Linux 10.3 and 9.9

    Red Hat Developers logo

    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
    Ask AI