Hi,

>From camel I invoke a webservice call, handled by cxf-bc, to multiple
destinations in parallel.

To specify the endpoint URI, I set the JbiConstants.HTTP_DESTINATION_URI
header.  This works great for the message delivery, however I also use the
MAPAggregator interceptor, which sets the WSA To value based on a reference
to the same EndpointReferenceType.  This results in the To value taking the
value of the last HTTP_DESTINATION_URI set (well depending on how quickly
the code runs).

In the xbean I use a ref to the aggregator

        <cxfbc:inInterceptors>
            ...
            <ref bean="mapAggregator"/>
            ...
        </cxfbc:inInterceptors>
        <cxfbc:outInterceptors>
            ...
            <ref bean="mapAggregator"/>
            ...
        </cxfbc:outInterceptors>
        <cxfbc:inFaultInterceptors>
            ...
            <ref bean="mapAggregator"/>
            ...
        </cxfbc:inFaultInterceptors>
        <cxfbc:outFaultInterceptors>
            ...
            <ref bean="mapAggregator"/>
            ...
        </cxfbc:outFaultInterceptors>

I took this from an example project.  

Does my configuraiton look wrong, or is this just a bug and
EndpointReferenceType shouldn't be shared?

I've made a change to MAPAggregator to use a new EndpointReferenceType,
which seems to work, but am worried there will be side-effects I've not
considered.

    private void addRoleSpecific(final AddressingPropertiesImpl maps,
            final Message message,
            final boolean isRequestor,
            final boolean isFault) {

...
                EndpointReferenceType reference;
/*
                if (conduit != null) {
                    reference = conduit.getTarget();
                } else {
                    reference = ContextUtils.getNoneEndpointReference();
                }
*/
                reference = new EndpointReferenceType();
                reference.setAddress(new AttributedURIType());

                // Override with the correct address
                reference.getAddress()
                    .setValue((String)
message.get(Message.ENDPOINT_ADDRESS));

                maps.setTo(reference);

I'm using:
smx 3.3.2
camel 2.5
cxf 2.2.6
servicemix-camel 2010.02
servicemix-cxf-bc 2010.01

Thanks for any advice.

Steve.

--
View this message in context: 
http://servicemix.396122.n5.nabble.com/HTTP-DESTINATION-URI-race-condition-in-MAPAggregator-tp4665769p4665769.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to