You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by lekkie <le...@gmail.com> on 2010/03/01 09:55:56 UTC

Passing Headers/Properties between (NMR) endpoints

Hi guys,

I 'd like to pass an header in between two NMR endpoints.

Here is my config:

<route>    	
    	<from ref="restURL" />
    	<!--
    	<setOutHeader headerName="routeId">
			<constant>myroute</constant>    
		</setOutHeader> 
		-->	
		<setProperty propertyName="routeId">
			<constant>myroute</constant>
		</setProperty>
    	<to uri="nmr:router1"/>  
    </route>     

and here is my router config

<route>
		<from uri="nmr:router1"/>		
		<setHeader headerName="routeId">
			<property>routeId</property>			 
		</setHeader>
		<bean ref="router1ProcessorRecipientList" method="route"/> 
</route>

I read somewhere you cannot propagate headers across endpoints, except
through properties, but the snippet above did not work.

I'd appreciate any insight into how can be properly done.

kr.
-- 
View this message in context: http://old.nabble.com/Passing-Headers-Properties-between-%28NMR%29-endpoints-tp27741184p27741184.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Passing Headers/Properties between (NMR) endpoints

Posted by lekkie <le...@gmail.com>.
Thanks for the response.

So, how is this (setting Exchange properties) done?


willem.jiang wrote:
> 
> Hi
> 
> I think the properties means to set the Camel Exchange properties.
> There is no properties for Camel Message.
> 
> Willem
> 
> lekkie wrote:
>> Hi guys,
>> 
>> I 'd like to pass an header in between two NMR endpoints.
>> 
>> Here is my config:
>> 
>> <route>    	
>>     	<from ref="restURL" />
>>     	<!--
>>     	<setOutHeader headerName="routeId">
>> 			<constant>myroute</constant>    
>> 		</setOutHeader> 
>> 		-->	
>> 		<setProperty propertyName="routeId">
>> 			<constant>myroute</constant>
>> 		</setProperty>
>>     	<to uri="nmr:router1"/>  
>>     </route>     
>> 
>> and here is my router config
>> 
>> <route>
>> 		<from uri="nmr:router1"/>		
>> 		<setHeader headerName="routeId">
>> 			<property>routeId</property>			 
>> 		</setHeader>
>> 		<bean ref="router1ProcessorRecipientList" method="route"/> 
>> </route>
>> 
>> I read somewhere you cannot propagate headers across endpoints, except
>> through properties, but the snippet above did not work.
>> 
>> I'd appreciate any insight into how can be properly done.
>> 
>> kr.
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Passing-Headers-Properties-between-%28NMR%29-endpoints-tp27741184p27752900.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Passing Headers/Properties between (NMR) endpoints

Posted by Willem Jiang <wi...@gmail.com>.
Hi

I think the properties means to set the Camel Exchange properties.
There is no properties for Camel Message.

Willem

lekkie wrote:
> Hi guys,
> 
> I 'd like to pass an header in between two NMR endpoints.
> 
> Here is my config:
> 
> <route>    	
>     	<from ref="restURL" />
>     	<!--
>     	<setOutHeader headerName="routeId">
> 			<constant>myroute</constant>    
> 		</setOutHeader> 
> 		-->	
> 		<setProperty propertyName="routeId">
> 			<constant>myroute</constant>
> 		</setProperty>
>     	<to uri="nmr:router1"/>  
>     </route>     
> 
> and here is my router config
> 
> <route>
> 		<from uri="nmr:router1"/>		
> 		<setHeader headerName="routeId">
> 			<property>routeId</property>			 
> 		</setHeader>
> 		<bean ref="router1ProcessorRecipientList" method="route"/> 
> </route>
> 
> I read somewhere you cannot propagate headers across endpoints, except
> through properties, but the snippet above did not work.
> 
> I'd appreciate any insight into how can be properly done.
> 
> kr.