Created
March 5, 2012 17:15
-
-
Save iocanel/1979554 to your computer and use it in GitHub Desktop.
A listener which echos messages added to a Hazelcast topic
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
public class EchoListener implements MessageListener<string> { | |
private ITopic topic; | |
public void onMessage(String message) { | |
System.out.println(message); | |
} | |
public ITopic getTopic() { | |
return topic; | |
} | |
public void setTopic(ITopic topic) { | |
this.topic = topic; | |
this.topic.addMessageListener(this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment