
Leading the Way: Payara Platform Community 7 Beta Now Fully Jakarta EE 11 Certified
We’re excited to announce that Payara Platform Community 7 Beta application server is now fully certified as Jakarta EE 11 […]
Payara Server comes bundled with OpenMQ, which implements the Java Message Service (JMS) standard.
For simple messaging scenarios, it is convenient to use embedded OpenMQ broker, which is available by default. However, this embedded OpenMQ is running inside the JVM instance of Payara Server. This implies that whenever one of them needs to be restarted, the other one gets restarted too.
We’ve seen reports of messages sometimes getting stuck inside the embedded OpenMQ broker and only getting processed after restarting whole Payara Server. This is not reasonable in more complex use cases with high availability in mind. Most often when clustering is involved, it is worth considering other options of running OpenMQ.
There are 3 modes for GlassFish to use OpenMQ: EMBEDDED, LOCAL and REMOTE. There is some overlap in what is involved with each of these. Section 10-2 of the official GlassFish Server Open Source Edition 4.0 High Availability Administration Guide gives the following definitions:
EMBEDDED | Conventional broker cluster with master broker (default) Conventional broker cluster of peer brokers |
LOCAL | Conventional broker cluster with master broker (default) Conventional broker cluster of peer brokers Enhanced broker cluster |
REMOTE |
Conventional broker cluster with master broker Remote brokers can differ in number from GlassFish instances and can be located on other hosts. |
Note that there are 2 more modes: LOCAL and REMOTE.
Both of them provide an additional option to use Enhanced broker cluster, which is more robust and guarantees 100% data availability and recovery at failover.
LOCAL mode means that OpenMQ broker is located on the same host as Payara Server instance. This is easier to manage, but the number of OpenMQ instances needs to be the same as number of Payara Server instances, making it impossible to scale them independently of each other.
REMOTE instances of OpenMQ need to be managed separately from Payara server instances, however, they can differ in number. Adding new instance of Payara server into the cluster does not require additional instance of OpenMQ broker.
A separate remote OpenMQ broker can be started using the imqbrokerd
command in the mq/bin
directory inside Payara Server installation.
Useful note |
Specify
The remedy is to use the command like the following (which also overrides the default port of 7676):
|
To shutdown OpenMQ, use the following command in Payara Server installation:
mq/bin/imqcmd shutdown bkr [-b host:port]
Payara Server installation comes with reasonable defaults to enable wide range of functionality out of the box without additional configuration. This also includes embedded OpenMQ broker, ready to be used immediately. However, LOCAL and REMOTE modes of running OpenMQ are also available. We highly encourage to switch to them in production deployments, especially when high availability is required. To improve reliability with recovery at failover, it is worth to consider using Enhanced broker cluster with LOCAL or REMOTE mode.
Share:
We’re excited to announce that Payara Platform Community 7 Beta application server is now fully certified as Jakarta EE 11 […]
Enterprise Java applications power global commerce, healthcare, government and countless other industries. These systems must be scalable, secure and […]
May 2025 marks a monumental milestone in software development: Java turns 30. The impact of this language on the […]
Is this also a problem with LOCAL, i’m having issues with a pair of payara servers clustered, with masterbroker and LOCAL. using JMSBrowser i can see many messages stuck in various queues. should i use a different remove JMS provider?
Hi Nick, please refer to the Payara Forum for the answer to your question: https://groups.google.com/forum/#!msg/payara-forum/3FSYz3pUQuQ/kG4dwKkNAwAJ