Skip to content

Instantly share code, notes, and snippets.

@iocanel
Created March 5, 2012 17:15
Show Gist options
  • Save iocanel/1979554 to your computer and use it in GitHub Desktop.
Save iocanel/1979554 to your computer and use it in GitHub Desktop.
A listener which echos messages added to a Hazelcast topic
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