Skip to content

Instantly share code, notes, and snippets.

@mheath
Created September 2, 2013 23:35
Show Gist options
  • Save mheath/6418208 to your computer and use it in GitHub Desktop.
Save mheath/6418208 to your computer and use it in GitHub Desktop.
CF NATS Example
Nats nats = new NatsConnector().addHost("nats://localhost").connect();
CfNats cfNats = new DefaultCfNats(nats);
cfNats.subscribe(ComponentDiscover.class, new PublicationHandler<ComponentDiscover, ComponentAnnounce>() {
@Override
public void onMessage(Publication<ComponentDiscover, ComponentAnnounce> publication) {
publication.reply(new ComponentAnnounce(...));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment