Hi,
I created a server using netty.
However , whenever i try to send a tcp iso9593 ascii channel jpos packet, there is no request received on server side.
can anyone please help regarding this ?
This is how the decoder for iso9593 looks like:
public class Iso8583Decoder extends ByteToMessageDecoder {
private final MessageFactory messageFactory;
public Iso8583Decoder(MessageFactory messageFactory) {
this.messageFactory = messageFactory;
}
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf byteBuf, List out) throws Exception {
//message body starts immediately, no length header
if (!byteBuf.isReadable()) {
return;
}
byte[] bytes = new byte[byteBuf.readableBytes()];
byteBuf.readBytes(bytes);
final IsoMessage isoMessage = messageFactory.parseMessage(bytes, 0);
if (isoMessage != null) {
//noinspection unchecked
out.add(isoMessage);
} else {
throw new ParseException("Can't parse ISO8583 message", 0);
}
}
}