camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Transform, Camel and null message bodies
Date Thu, 21 Nov 2013 15:37:22 GMT
What do you need to do in the jython code? It seems you are not doing
a message transformation, but want to execute some script or use it as
a predicate?

request.headers['MyHeader']='Something'

seems like a predicate?

If you want to run a script you can use the language component and set
transform=false
http://camel.apache.org/language

On Thu, Nov 21, 2013 at 1:22 PM, APinto <armeniopinto@gmail.com> wrote:
> Hello all!
>
> In this specific application of Camel, we have the requirement of writing as
> much as possible message processing code in Python/Jython.
>
> This took me to <transform> and <python>. The solution would look like (we
> are using Camel 2.12.1 and Jython 2.5.3):
>
> ...
> <tranform>
>     <python>resource:classpath:transformation.py</python>
> </transform>
> ...
>
> The Jython code would look like, for example:
>
> request.headers['MyHeader']='Something'
>
> The problem is that the routes are failing saying that the body is null
> after the transformation. If I add the line response.body=request.body to
> the Jython script, the compilation fails saying that the name 'response' is
> not defined.
>
> I searched as much as I could but I couldn't find a solution to the problem.
> Could any of you help me please?
>
> Thank you very much for your attention, regards,
>
> AP
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Transform-Camel-and-null-message-bodies-tp5743617.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message