You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ychawla <pr...@yahoo.com> on 2012/04/18 21:07:44 UTC
Retrieve Endpoint in Recipient List OnPrepareRef
Hello All,
Consider a simple recipient list:
<camel:recipientList delimiter="," parallelProcessing="false"
onPrepareRef="prepareMessage">
<camel:header>RecipientListHeader</camel:header>
</camel:recipientList>
The Recipient List header has the contents: endpoint1, endpoint2
The endpoints are defined as:
<endpoint id="endpoint1" uri="direct:a"/>
<endpoint id="endpoint2" uri="direct:b"/>
In my 'prepareMessage' processor, I want to access the endpoint that I am
calling. This is because I want to enrich this endpoint dynamically with
headers for example operationName and operationNamespace.
In the exchange properties, I can see 'direct:a' but not 'endpoint1'. Is
there a way I can access the endpoint name rather than the endpoint URI in
the OnPrepareRef processor?
Thanks,
Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/Retrieve-Endpoint-in-Recipient-List-OnPrepareRef-tp5649956p5649956.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Retrieve Endpoint in Recipient List OnPrepareRef
Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Apr 18, 2012 at 9:07 PM, ychawla <pr...@yahoo.com> wrote:
> Hello All,
> Consider a simple recipient list:
>
> <camel:recipientList delimiter="," parallelProcessing="false"
> onPrepareRef="prepareMessage">
> <camel:header>RecipientListHeader</camel:header>
> </camel:recipientList>
>
> The Recipient List header has the contents: endpoint1, endpoint2
>
> The endpoints are defined as:
>
> <endpoint id="endpoint1" uri="direct:a"/>
> <endpoint id="endpoint2" uri="direct:b"/>
>
> In my 'prepareMessage' processor, I want to access the endpoint that I am
> calling. This is because I want to enrich this endpoint dynamically with
> headers for example operationName and operationNamespace.
>
> In the exchange properties, I can see 'direct:a' but not 'endpoint1'. Is
> there a way I can access the endpoint name rather than the endpoint URI in
> the OnPrepareRef processor?
>
Just access the RecipientListHeader header from the OnPrepareRef processor
Something a like:
Object value = exchange.getIn().getHeader("RecipientListHeader");
> Thanks,
> Yogesh
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Retrieve-Endpoint-in-Recipient-List-OnPrepareRef-tp5649956p5649956.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/