A STOMP server which maps all SEND and SUBSCRIBE commands to HazelcastMQ Core producers and consumers. This allows non-Java components (such as C, C++, Python, Ruby, etc.) to interact with the MQ capabilities of HazelcastMQ. HazelcastMQ STOMP may be used to integrate into existing frameworks such as Apache Camel's while not requiring any of the JMS complexity.
- STOMP 1.1 and 1.2 protocols
- Sending and subscribing
- Multiple clients on single server
- Queue and Topic send/receive
- Header encoding/decoding of special characters
- Transactions (BEGIN, SEND, COMMIT, ABORT)
- Acks (ACK, NACK)
- Transaction message reception or ACK/NACK (i.e. always auto ACK)
HazelcastMQConfig mqConfig = new HazelcastMQConfig();
mqConfig.setHazelcastInstance(hazelcast);
HazelcastMQInstance mqInstance = HazelcastMQ
.newHazelcastMQInstance(mqConfig); // (1)
HazelcastMQStompConfig stompConfig = new HazelcastMQStompConfig(
mqInstance); // (2)
HazelcastMQStompInstance stompServer = HazelcastMQStomp.
newHazelcastMQStompInstance(stompConfig); // (3)
log.info("Stomp server is now listening on port: "
+ stompConfig.getPort());
Using HazelcastMQ STOMP requires configuring a simple layer on the Core functionality:
- Create a HazelcastMQ instance
- Create a stomp configuration
- Create a stomp server
- Connect with STOMP clients
Using the Stomp Server on top of HazelcastMQ Core allows Hazelcast to be used as a distributed messaging system for components written in any language. The STOMP protocol is lightweight and simple to understand.
View the example.
Using the Stomp Server on top of HazelcastMQ Core allows a STOMP message to be sent from a STOMP client and then consumed by a JMS consumer as a JMS Message. This allows non-Java components to produce and consumer messages while allowing Java components to use the rich JMS API and enterprise integration patterns.
View the example.