| = Atom Component |
| :doctitle: Atom |
| :shortname: atom |
| :artifactid: camel-atom |
| :description: Poll Atom RSS feeds. |
| :since: 1.2 |
| :supportlevel: Stable |
| :tabs-sync-option: |
| :component-header: Only consumer is supported |
| //Manually maintained attributes |
| :camel-spring-boot-name: atom |
| |
| *Since Camel {since}* |
| |
| *{component-header}* |
| |
| The Atom component is used for polling Atom feeds. |
| |
| Camel will poll the feed every 60 seconds by default. + |
| *Note:* The component currently only supports polling (consuming) |
| feeds. |
| |
| Maven users will need to add the following dependency to their `pom.xml` |
| for this component: |
| |
| [source,xml] |
| ------------------------------------------------------------ |
| <dependency> |
| <groupId>org.apache.camel</groupId> |
| <artifactId>camel-atom</artifactId> |
| <version>x.x.x</version> |
| <!-- use the same version as your Camel core version --> |
| </dependency> |
| ------------------------------------------------------------ |
| |
| == URI format |
| |
| [source,java] |
| ------------------------ |
| atom://atomUri[?options] |
| ------------------------ |
| |
| Where *atomUri* is the URI to the Atom feed to poll. |
| |
| |
| // component-configure options: START |
| |
| // component-configure options: END |
| |
| // component options: START |
| include::partial$component-configure-options.adoc[] |
| include::partial$component-endpoint-options.adoc[] |
| // component options: END |
| |
| // endpoint options: START |
| |
| // endpoint options: END |
| |
| |
| == Exchange data format |
| |
| Camel will set the In body on the returned `Exchange` with the entries. |
| Depending on the `splitEntries` flag Camel will either return one |
| `Entry` or a `List<Entry>`. |
| |
| [width="100%",cols="10%,10%,80%",options="header",] |
| |======================================================================= |
| |Option |Value |Behavior |
| |`splitEntries` |`true` |Only a single entry from the currently being processed feed is set: |
| `exchange.in.body(Entry)` |
| |
| |`splitEntries` |`false` |The entire list of entries from the feed is set: |
| `exchange.in.body(List<Entry>)` |
| |======================================================================= |
| |
| Camel can set the `Feed` object on the In header (see `feedHeader` |
| option to disable this): |
| |
| // component headers: START |
| include::partial$component-endpoint-headers.adoc[] |
| // component headers: END |
| |
| == Examples |
| |
| === Consumer Example |
| |
| In this sample, we poll James Strachan's blog. |
| |
| [source,java] |
| --------------------------------------------------------------------------------- |
| from("atom://http://macstrac.blogspot.com/feeds/posts/default").to("seda:feeds"); |
| --------------------------------------------------------------------------------- |
| |
| In this sample, we want to filter only good blogs we like to a SEDA |
| queue. |
| The sample also shows how to set up Camel standalone, not running |
| in any Container or using Spring. |
| |
| |
| include::spring-boot:partial$starter.adoc[] |