Last active
August 29, 2015 14:02
-
-
Save mpilone/6ceb9ed7b92dd15c44e8 to your computer and use it in GitHub Desktop.
An example of creating a reliable, distributed, and elastic STOMP server using HazelcastMQ on top of Hazelcast.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HazelcastInstance hazelcast = Hazelcast.newHazelcastInstance(); | |
HazelcastMQConfig mqConfig = new HazelcastMQConfig(); | |
mqConfig.setHazelcastInstance(hazelcast); | |
HazelcastMQInstance mqInstance = HazelcastMQ.newHazelcastMQInstance(mqConfig); | |
// Create the server. | |
HazelcastMQStompConfig stompConfig = new HazelcastMQStompConfig(mqInstance); | |
HazelcastMQStompInstance stompServer = HazelcastMQStomp.newHazelcastMQStompInstance(stompConfig); | |
// Create a client. | |
StompClient stompClient = new StompClient("localhost", stompConfig.getPort()); | |
stompClient.connect(); | |
// Send a message. | |
Frame frame = FrameBuilder.send("/queue/demo.test", "Hello World!").build(); | |
stompClient.send(frame); | |
// Sit back and enjoy! More at https://github.com/mpilone/hazelcastmq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment