Transformation
Now that we have feeds in the RSS format, let's transform it to appropriate formats so that the endpoints responsible for persisting in the database, putting it on the JMS channel, and sending it as a mail, can understand that. The splitter will put one message at a time on the channel splittedFeedChannel
. Let's declare this as a pub-sub channel and attach three endpoints, which will be our transformers. Configure the pub-sub channel as follows:
<int:publish-subscribe-channel id="splittedFeedChannel"/>
The configuration for the three transformers that we have used is as follows:
<bean id="feedDbTransformerBean" class="com.cpandey.siexample.transformer.SoFeedDbTransformer" /> <bean id="feedJMSTransformerBean" class="com.cpandey.siexample.transformer.SoFeedJMSTransformer" /> <bean id="feedMailTransformerBean" class="com.cpandey.siexample.transformer.SoFeedMailTransformer" />
The DB transformer
Let's write the transformer component from the Spring Integration...