Created
October 7, 2015 21:37
-
-
Save anonymous/246402cac90648b307e5 to your computer and use it in GitHub Desktop.
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
import com.hazelcast.core.Topic; | |
import com.hazelcast.core.Hazelcast; | |
import com.hazelcast.core.MessageListener; | |
public class Sample implements MessageListener { | |
public static void main(String[] args) { | |
Sample sample = new Sample(); | |
Topic topic = Hazelcast.getTopic ("default"); | |
topic.addMessageListener(sample); | |
topic.publish ("my-message-object"); | |
} | |
public void onMessage(Object msg) { | |
System.out.println("Message received = " + msg); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment