Does RSS push or pull updates?
Asked Answered
H

2

10

Please note: Although I mention Java 8 I think the answer here is really language-agnostic.


I'm building a simple Java 8 web service that will aggregate RSS feeds across various topics and make their content available by request. I've never worked with RSS before and all the videos I have found are just about how to generate an RSS file for your lame blog, and all the articles I have found on "Java and RSS" are just examples of parsing XML.

I'm curious: does RSS work as push or pull?

  • By "push" I mean: say "RSS feed A" publishes an update to their RSS file on their service (say http://rss-a.example.com/rss/news.rss). Does their server somehow send a message to my backend, alerting my backed that an update is ready?; or
  • By "pull" I mean: is my backend just responsible for pinging all of the RSS feed URLs every n seconds and pulling in new content as its published?

Also, how do Java libraries like ROME snap into either push/pull architecture above?

Handle answered 5/12, 2017 at 20:19 Comment(0)
D
19

RSS is just a data format. Nothing more. It neither pushes nor pulls.

It is typically accessed by polling (and the format includes the ability to specify how often it should be polled as metadata).

This doesn't prevent you from creating a (or finding an existing) a service which you can send the data to a client instead of having them request it over HTTP. Nor one where you send a message informing them that the feed has updated and they should make a new HTTP request.

Dissimilar answered 7/12, 2017 at 20:25 Comment(4)
Thanks @Dissimilar (+1) - so does a typical solution work like this maybe (???): (1) Content provider hosts an *.rss file (which I assume is XML) on some web link. (2) Some process ("RSS client" for lack of better term) fetches the RSS file and consults its data for how often it should check the same RSS file for updates/changes. (3) Periodically, the RSS file fetches the RSS file, parses it, extracts updated content from it, and does whatever it wants with that new content. Yes? Or am I way off?Handle
Yes. Assuming a reasonably smart RSS engine. Some will just poll on a fixed rate.Dissimilar
Great thanks for that confirmaton, final followups (I promise!): That ROME library (linked above) is a Java library but all the terms on its homepage seem generic to RSS. (1) Looks like they have a Fetcher Module that can read remote RSS files (via HTTP GET) into some in-memory representation of the RSS file, yes? And (2) they also seem to have a Propono Module which is some type of implementation of the "Atom Publishing Protocol...how does Atom snap into the RSS equation?Handle
There are half a dozen semi-compatible versions of RSS, most of which don't quite cover a lot of use cases. Atom is the spec that came about when people learned from the mistakes of RSS and tried to create something better. Any decent RSS library will handle Atom too.Dissimilar
R
0

If you are writing software that needs a real-time notification of when an RSS or Atom feed has changed, you can use the protocols WebSub or RssCloud.

WebSub was once called PubSubHubbub. There's a GitHub account with more information on the protocol and some code for PHP and WordPress that uses it.

Ropy answered 12/1, 2018 at 16:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.