The scenario is a third party application will send messages to jpos. possibility is that it will send two types of messages with different message header length say one will be length 22 bytes and another will be 44 bytes.the packager will be same.
How can I handle both the messages and route it to the issuers based on the header type? The first 4 bytes in the header will give me the clue what will be header length.
For example
f3f8f6f7 -- means header length is 22 bytes
f4f5f6f7 -- means header length is 44 bytes
sample : header="3867000000000000000002" or "45670000000000000000021601" upto 44
I am not sure where to start. I understand I can create two channels but issue is I have to listen from one endpoint port
If I want to create a custom channel what is the best way to handle this scenario? Just thinking is it possible to handle as below, in the channel header property I can specify multiple headers?
<server class="org.jpos.q2.iso.QServer" logger="Q2" name="gwmip-server-7003" realm="bnet-server-8000">
<attr name="port" type="java.lang.Integer">7003</attr>
<channel class="org.jpos.iso.channel.NACChannel"
packager="org.jpos.iso.packager.GenericPackager"
type="server"
logger="Q2"
header="3687000000000000000002" or "3687000000000000000002"
>
<property name="packager-config" value="cfg/packager/CISebcdic.xml" debug="True" />
<property name="timeout" value="180000"/>
</channel>
<request-listener class="org.jpos.iso.IncomingListener" logger="Q2" realm="incoming-request-listener">
<property name="queue" value="GWMIPTXNMGR" />
<property name="ctx.DESTINATION" value="jPOS-AUTORESPONDER" />
</request-listener>
</server>
I have no clue how to handle this.