Consume XML Push Data Feed on Open Channel with Java

I am looking for some example Java code and/or utility library for consuming an XML push data feed over http.

I already know how to consume and parse a basic XML feed using XStream and STax. That is - I can send an XML request over http, get an xml response back and process it.

However, I have an option to subscribe to a data feed. The connection is kept open and the server pushes any new data onto the channel. I then need to process any data as it becomes available.

I can probably figure it out on my own, but it is always better to see some examples. I thought that this kind of data-feed-subscription would be fairly common. But I can't seem to find any examples. Maybe I am just searching on the wrong key words?

I would appreciate it if anyone knows of a Java framework/utility and/or example code for consuming a push xml data feed over http.

Thanks.

1 Answer

  1. Leander- Reply

    2019-11-13

    HTTP push isn't really quite defined term and there are several ways to do it. Best approach is to use appropriate client (be it comet, web-sockets, HTTP streaming or whatever) and see what kind of interface it provides. There will probably be an easy way of connecting you existing XML parser to it.

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>