When I send byte array to response channel I expect to send only that byte-array to the socket. For example, in spring integration ip.
@ServiceActivator(inputChannel = "serviceChannel")
public byte[] service(byte[] byteArray) {
return new byte[]{0,2,1,0};
}
I expect it to send
00, 02, 01, 00
But! This will also send two additional bytes to the stream
00, 02, 01, 00 , 0D, 0A
for end of message. I do NOT want to send those bytes, i.e. I'd like to omit them. How can this be achieved?
I suspect this has to do with how sockets interpret messages, but I did not find where this happens, no matter how I tried.
upd: I found the problem: Spring in my configuration uses class ByteArrayCrLfSerializer but I need to use ByteArrayRawSerializer. How can I do this?