Java Examples

From Open Rail Data Wiki
Revision as of 17:54, 9 July 2013 by Jonathon Hurley (talk | contribs) (Created new Java examples page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Gorizza Stomp library

This code requires the Gozirra Stomp library.

private static void go() throws Exception
       final Client c = new Client(Constants.SERVER, Constants.PORT, Constants.USERNAME, Constants.PASSWORD);
       for (final String topic : Constants.TOPICS)
           System.out.println("  " + topic);
           c.subscribe("/topic/" + topic,
                   new Listener()
                       public void message(Map map, String s)
                           processMessage(map, s);
       System.out.println("done subscribing");