Hello!
I'm new to the Spring Integration project, please excuse if my question is quite simple.
What is the difference between the following cases?
andCode:public Message<List<String>> transform(AuthProtocolDocument payload, @Headers Map<String, Object> headers) { // some deal with payload and headers, // returning result }
The first sample works quite good, but the second one fails with MessagingHandlingExceptionCode:public Message<List<String>> transform(Message<AuthProtocolDocument> message) { AuthProtocolDocument payload = message.getPayload(); Map<String, Object> headers = message.getHeaders(); // some deal with payload and headers, // returning result }
(handler requires a reply, but no reply was received). My transformer's code is not executed in this case.
And this fail is not stable, one of about five similar runs is successful.
I'm using this transformation to convert XmlBean object, received from other service, to my domain pojo. I'm not sure I'm using headers
properly. Received message may contain an error response code and I want to throw an domain exception from the gateway. I think that this transformer
is the only component that knows something about response message structure and it have to check the response code and generate an exception.
Also I don't want to add response codes to my domain pojo.
I'll be thankful if someone suggest me how to throw the domain specific exception from the gateway without mixing of payload and headers
transformation in the same transformer.
Thanks!
Best Regards,
-- Alexei Pomelov


Reply With Quote
