camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Missing Headers in pipline with bean components
Date Wed, 14 May 2008 20:05:58 GMT
OK I've applied my batch to the BeanEndpoint class now if someone
wants to dive in hacking it :)

2008/5/14 James Strachan <james.strachan@gmail.com>:
> I think this could be a bug in the bean endpoint, not copying headers
> by default. Bean endpoints and bean transformers should probably by
> default preserve all headers and just by default set the output body
> (unless folks do clever stuff like inject the OutHeaders parameter Map
> or something).
>
> I had a quick look at BeanProcessor and it does look like it never
> bothers to copy properties across. We should probably create a few
> test cases & make it configurable so that by default headers are
> copied across (though we can configure the endpoint to enable/disable
> this).
>
> I've a pending patch to Bean endpoint that I'll be committing shortly
> (once this test run works) - which changes the bean endpoint code a
> little - and makes it easier to create & configure a BeanEndpoint in
> Spring XML or Guice etc. Once thats in we can tinker with the bean
> endpoint some more. If anyone fancies diving into this one before me
> (I'll be travelling & in meetings alot the next 2 days) lets start
> with some test cases first that demonstrate the issue; then hopefully
> my patch will be committed...
>
> 2008/5/14 vmasina <vijay.masina@intraisp.com>:
>>
>>
>> Is it by design Headers will not be propagated to next component in the
>> route, after the bean component in the route?
>>
>> We are trying to process a message on queue, with a custom header set used
>> as correlation id, which will invoke two bean components in pipeline. Based
>> on the response from the pipline the status should be updated in the
>> database using the the customer header set on the original message.
>>
>> Route defenition:
>>
>> //STUDENT_ID header set on send
>> from("activemq:queue:provider2AsyncQueue")
>> .unmarshal().xstream()
>> .pipeline(
>>        "bean:PROVIDER2_TRANSFORMER",
>>        "bean:PROVIDER2?methodName=executeRequest",
>>        "activemq:queue:updateThirdPartyProvisioningStatus");
>>
>> //UPDATE STATUS AFTER PROCESSING THE THIRD PARTY REQUEST
>> from("activemq:queue:updateThirdPartyProvisioningStatus")
>> .process(new Processor(){
>>        public void process(Exchange arg0) throws Exception {
>>                System.out.println( arg0.getIn().getHeader("STUDENT_ID"));
>>        }
>> });
>>
>>
>> I am not able retrive the STUDENT_ID header while processing
>> "bean:PROVIDER2?methodName=executeRequest" or processing the
>> "activemq:queue:updateThirdPartyProvisioningStatus"
>>
>> The header is available to the PROVIDER2_TRANSFORMER.
>>
>> Please provide some advice.
>>
>>
>>
>> --
>> View this message in context: http://www.nabble.com/Missing-Headers-in-pipline-with-bean-components-tp17234481s22882p17234481.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://open.iona.com
>



-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Mime
View raw message