You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by IgnatiusReilly <el...@gmail.com> on 2014/12/18 20:25:04 UTC

Creation of a Custom Component with URI parameters

Hi,

I am trying to create a custom component with URI parameters. I haven't
found an example that shows the full implementation of this kind of
component so I modified the example from the Camel in Action book in order
to add a URI parameter. To do so, I modified the following classes:

HelloWorldEndpoint - added the following lines



HelloWorldComponentTest - modified the return new RouteBuilder() method:


The thing is that when I try to retrieve the value of "param" in the
Producer (using exchange.getProperties()) it is not there.



What am I doing wrong?

Thanks,




--
View this message in context: http://camel.465427.n5.nabble.com/Creation-of-a-Custom-Component-with-URI-parameters-tp5760889.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Creation of a Custom Component with URI parameters

Posted by IgnatiusReilly <el...@gmail.com>.
Hi Claus,

Thanks for your quick answer. I was able to retrieve the value from in the
producer from the endpoint.

IR





--
View this message in context: http://camel.465427.n5.nabble.com/Creation-of-a-Custom-Component-with-URI-parameters-tp5760889p5760925.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Creation of a Custom Component with URI parameters

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Dec 18, 2014 at 8:25 PM, IgnatiusReilly <el...@gmail.com> wrote:
> Hi,
>
> I am trying to create a custom component with URI parameters. I haven't
> found an example that shows the full implementation of this kind of
> component so I modified the example from the Camel in Action book in order
> to add a URI parameter. To do so, I modified the following classes:
>
> HelloWorldEndpoint - added the following lines
>
>
>
> HelloWorldComponentTest - modified the return new RouteBuilder() method:
>
>
> The thing is that when I try to retrieve the value of "param" in the
> Producer (using exchange.getProperties()) it is not there.
>

Those are 2 different things. The value is an option on the endpoint.
So you can access the value from the producer, where you can put the
value on the exchange, anywhere you like. Though usually as a header.



>
>
> What am I doing wrong?
>
> Thanks,
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Creation-of-a-Custom-Component-with-URI-parameters-tp5760889.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/