camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen">
Subject RE: Transformation task in Spring
Date Fri, 25 Jul 2008 08:47:47 GMT

You can use a processor or bean to do the transformation in plain old good java ;)

The bean can be configured in spring as:
<to uri="bean:mySpringBean"/>

And the processor as:
<process ref="mySpringBeanThatImplementsProcessor"/>

And then you need the regular spring beans configuration in spring as well to link to the
actual class file
<bean id="mySpringBeanThatImplementsProcessor" class="xxx.yyy"/>
<bean id="mySpringBean" class="xxx.yyy.zzz"/>

mySpringBean is just a regular POJO that doesn't have to have import any camel classes.

mySpringBeanThatImplementsProcessor must implement the Processor interface.

You can also do xpath since your payload is XML. Then you will be able to match and grab the
textpart quite simple

I am no xpath expert but it is something like this:

Med venlig hilsen
Claus Ibsen
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576

-----Original Message-----
From: MMA [] 
Sent: 25. juli 2008 10:09
Subject: Transformation task in Spring


I am new to ActiveMQ / camel. Up to now I was not able to solve the
following problem:

I have this xml structure in a file:

<textbody>Text TextTextTextTextText</textbody>

I configure a route in camel that reads the file from the file system (from
uri file...).
finally I want to send a eMail using the uri smtp (to uri smtp).

But before sending it to the smtp uri i have to do a transformation. That is
my problem.
How can I configure in xml-spring that the content of my source file in the
tag "textbody" is shifted to the mail text of the smtp uri.

Thank you for any hints.


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message