Skip to content
Jeremy Miller edited this page Feb 21, 2019 · 4 revisions

Welcome to the JeroMQ-JMS which is simply a wrapper around ZERO MQ to enable JEE applications to use the ZMQ protocol. The 220KB jar appart from ZEROMQ has ZERO other dependencies. This version uses the 0.4.3 ZMQ since I developed the wrapper using JERO, but it should also work with JNI instances.

Core to the wrapper is the Gateway classes that act a publisher or subscriber within JMS to/from ZMQ. A gateway contains the protocol for the interaction with the external communicating instances. It also contains 1 or more Sockets, to enable failure, and parallel through put. In summary each socket session get there own thread to handle the interaction between the actual ZMQ socket instance and the 2 transfer queues (incoming, outgoing). These transfer queues provide the gateway between ZMQ threads and external threads.

Each gateway has a primary direction, either outgoing, or incoming. All the examples and test use both types to test the ZERO MQ functionality.

The JMS wrapper has been designed to be extened;

  • the socket type (PUB, SUB, PULL, PUSH, etc…);
  • the adaptor/marshal for JMS messages to/from and external ZMQ format;
  • the subscription of messages using ZMQ functionality;
  • the JNDI context
  • the optional journal store to provide DR recovery
  • and more.

The library was aimed to work with Spring and with Tomcat. However, it should work in other JEE servers (i.e. Wildfly). For this reason I have implement a JMS URI. Sadly there is no open standard, but it is loosely based a similar functionality in Apache MQ.

Why bother? By and large this is true. It only has a limited scope within the JMS world which are much more robust, but for those that do not care to much about transactions, and duplications, but want raw speed it does have some merit, or those that wish to a JavaEE only within there application to external applications. JeroMQ-JMS was written to be incorporated in another large application which involves the mash-up of distributed and disparate data to be queried and viewed in real time (zero copy of sorts). By using the JMS API as the messaging standard it allows choice (i.e. RabbitMQ, and combinations there-of, etc…), along with communicating with non JMS applications.

Clone this wiki locally