When using a WSInboundGateway in Spring Integration Java DSL, is there a way to extract a header (its value) and use it for example to populate an Enum?
I've tried this but the SpEL does not evaluate:
@Bean
public IntegrationFlow aFlow() {
return IntegrationFlows.from(aWSInboundGateway())
.transform(
new GenericTransformer<JAXBElement<SomeStruct>, SpecificEvent>() {
@Override
public SpecificEvent transform(JAXBElement<SomeStruct> payload) {
return new SpecificEvent(
payload.getValue(),
Source.valueOf("headers['source']")
);
}
})
.channel(someChannel())
.get();
}