Accept request from jpos ascii channel ?

18 views
Skip to first unread message

mrtechit

unread,
Jul 23, 2017, 6:49:01 AM7/23/17
to Netty discussions
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);
        }
    }
}
Reply all
Reply to author
Forward
0 new messages