As per the documentation, http headers should be mapped into the SwitchYard Context as Scope.MESSAGE properties, and back. However, on the way in, http headers are mapped as Scope.MESSAGE and Scope.EXCHANGE properties. This is caused by the changes for SWITCHYARD-2828, and the added call to the copyHttpHeadersToContext function: https://github.com/jboss-switchyard/switchyard/blob/master/components/soap/src/main/java/org/switchyard/component/soap/composer/SOAPContextMapper.java#L111 This is redundant, and not aligned with the documentation. On the way out, properties from both scopes are added as http headers: https://github.com/jboss-switchyard/switchyard/blob/master/components/soap/src/main/java/org/switchyard/component/soap/composer/SOAPContextMapper.java#L158 https://github.com/jboss-switchyard/switchyard/blob/master/core/bus/camel/src/main/java/org/switchyard/bus/camel/CamelCompositeContext.java#L112-L117 This has the negative side effect that if the same property is contained in both the MESSAGE and the EXCHANGE context, but with different values, it is non-deterministic which one ends up in the http headers, due to the usage of a HashSet. This can be reproduced with the attached sample application (running the junit tests succeeds sometimes, and fails at other times). |