Java Examples: Difference between revisions

From Open Rail Data Wiki
Created new Java examples page
 
EvelynSnow (talk | contribs)
Remove old sample, Gozirra is a horrid STOMP library, but also no longer works on the feeds
Tag: Replaced
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Gorizza Stomp library==
This page left intentionally blank.


This code requires the [http://www.germane-software.com/software/Java/Gozirra/ Gozirra Stomp library].
{{Navtable-DataFeeds}}
 
<code>
private static void go() throws Exception
    {
        System.out.println("Connecting");
        final Client c = new Client(Constants.SERVER, Constants.PORT, Constants.USERNAME, Constants.PASSWORD);
        System.out.println("Connected");
        System.out.println("Subscribing");
        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");
    }
</code>


[[Category:Network Rail Data Feeds]]
[[Category:Network Rail Data Feeds]]
[[Category:Example Code]]

Latest revision as of 15:43, 26 October 2023