Hi,
When executing a client and a server in separate JVMs/Spring contexts, messages passed between them using UDP adapters loses header values and custom headers. Actually there's no difference in behaviour if the client and the server executes in the same JVM/context. When a message arrives at the server side it appears to be a different message with different timestamp and id. The payload is the same, though
Is this the intention? I have searched for an explanation in the reference manual, the forums, and the internet without any result. Must have missed something...
My assumption was that a Spring Integration messages would get transported over the network without change in the message headers. According to the goal "The framework should enforce separation of concerns between business logic and integration logic".
Here's an excerpt from the client log:
And from the server log:Code:2012-01-10 10:22:03,692 [main] DEBUG org.springframework.integration.ip.udp.UnicastSendingMessageHandler - Sent packet for message [Payload=foo][Headers={timestamp=1326187323692, id=b4a72eb0-9113-46fe-86ea-f20a2d58e05f, FOOHEADERNAME=FOOHEADERVALUE}]
Have also done a little code browsing... In .../integration/ip/udp/DatagramPacketMessageMapper.java, it's obvious that headers aren't copied to the datagram packet.Code:2012-01-10 10:22:03,724 [UDP-Incoming-Msg-Handler] DEBUG org.springframework.integration.ip.udp.UnicastReceivingChannelAdapter - Received:[Payload=[B@105bd58][Headers={timestamp=1326187323724, id=db09ae6a-a461-4a73-bfff-dbf70c716c06, ip_address=127.0.0.1, ip_hostname=127.0.0.1}]
Regards,
beam




Reply With Quote
