I wonder if it is possible to create a UDP server with spring-integration framework that is able to accept requests and return responses.
For TCP there are TCP gateways which allow request/response processing but I don't see similar thing for UDP.
It is easy to setup UDP listener and receive packets but then I don't see how to return a response as I can only route it to a predefined output channel.
Also I don't see sender's IP and port as the transformer doesn't receive the DatagramPacket object but only the data.
Here is my configuration:
<int:channel id="ChannelIn" />
<ip:udp-inbound-channel-adapter id="ChannelReceiver"
channel="ChannelIn"
port="5555"
multicast="false"
check-length="false"
pool-size="10"
/>
<int:transformer
ref="datagramToPacketTransformer"
input-channel="ChannelIn"
output-channel="ChannelSA"
method="toPacket"/>
<int:channel id="ChannelSA" />
<int:service-activator id="ChannelActivator"
input-channel="ChannelSA"
ref="PacketHandler"
method="process"
/>