'Marshaller in spring integration
I am trying to marshal java objects to xml in spring integration. i've tried to use new MarshallingTransformer. but i don't know how to pass the marshaller into it. This is my code:
return IntegrationFlows.from(Http.inboundGateway("/foo")
.requestMapping(m -> m.methods(HttpMethod.POST)
)
)
.transform(xmlToObjectTransformer)
.convert(Customer.class)
.transform(new MarshallingTransformer("the marshaller should come here"))
.get();
Solution 1:[1]
The question is not clear. You probably need to learn what are those marshallers and how to configure them: https://docs.spring.io/spring-framework/docs/current/reference/html/data-access.html#oxm.
Then you just need to have a bean for respective Marshaller and inject it into that MarshallingTransformer ctor.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Artem Bilan |
