blob: 8d560f3792d221e293918e65da1e45e6b80a9b53 [file] [log] [blame]
[[rss-dataformat]]
= RSS DataFormat
:page-source: components/camel-rss/src/main/docs/rss-dataformat.adoc
*Since Camel 2.1*
The RSS component ships with an RSS dataformat that can be used to
convert between String (as XML) and ROME RSS model objects.
* marshal = from ROME `SyndFeed` to XML `String`
* unmarshal = from XML `String` to ROME `SyndFeed`
A route using this would look something like this:
The purpose of this feature is to make it possible to use Camel's lovely
built-in expressions for manipulating RSS messages. As shown below, an
XPath expression can be used to filter the RSS message:
TIP: *Query parameters*
If the URL for the RSS feed uses query parameters, this component will
understand them as well, for example if the feed uses `alt=rss`, then
you can for example do
`from("rss:http://someserver.com/feeds/posts/default?alt=rss&splitEntries=false&delay=1000").to("bean:rss");`
== Options
// dataformat options: START
The RSS dataformat supports 1 options, which are listed below.
[width="100%",cols="2s,1m,1m,6",options="header"]
|===
| Name | Default | Java Type | Description
| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc.
|===
// dataformat options: END
// spring-boot-auto-configure options: START
== Spring Boot Auto-Configuration
When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration:
[source,xml]
----
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-rss-starter</artifactId>
<version>x.x.x</version>
<!-- use the same version as your Camel core version -->
</dependency>
----
The component supports 6 options, which are listed below.
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
| *camel.component.rss.basic-property-binding* | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | Boolean
| *camel.component.rss.bridge-error-handler* | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | Boolean
| *camel.component.rss.enabled* | Enable rss component | true | Boolean
| *camel.component.rss.lazy-start-producer* | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | Boolean
| *camel.dataformat.rss.content-type-header* | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc. | false | Boolean
| *camel.dataformat.rss.enabled* | Enable rss dataformat | true | Boolean
|===
// spring-boot-auto-configure options: END
ND