Thanks Gary!
I noticed that the remote IP address is in the headers, but the remote port is wrong, I made some changes to add it.
I extended UnicastReceivingChannelAdapter to override asyncSendMessage where the message is built. I also had to extend the DatagramPacketMessageMapper. It would be easier if I could just introduce my own implementation of the DatagramPacketMessageMapper into the UnicastReceivingChannelAdapter, but that is not possible.
Then in spring configuration I deleted
<ip:udp-inbound-channel-adapter id="ChannelReceiver"...>
and the following is added
<bean id="udpInboundChannelAdapterBean" class="me.spring.integration.udp.UnicastReceivingChannelAdapterExt" init-method="run"> <constructor-arg name="port" value="5555" /> <property name="poolSize" value="10"/> <property name="lookupHost" value="false"/> <property name="outputChannel" ref="ChannelIn" />
This seems to work, although I did not have time to fully test it.
My idea is to use the remote IP address and port and the DatagramSocket link from udpInboundChannelAdapterBean to create a new activation service that simply writes the response to the socket.
I will open a new jira for the remote port, as you expected.
source share