Incoming request is being processed by jpos channel.xml instead of server.xml

871 Views Asked by At

I am sending requests to a 3rd party ISO Server, this 3rd party also connects to my JPOS ISO Server in order to send requests to me(incoming requests). Before anything else, I am supposed to do a successful sign-on and also send network messages. Sign-on and sending Network messages are all working as expected. I am also able to send fund transfer requests successful to the 3rd party too.

The issue now is, when the 3rd party initiates a request(incoming requests) to my ISO Server, it goes to 10_mychannel.xml instead of 50_my_server.xml. How do I make it go to my 50_my_server.xml and call my listener class.

Please note that I am however able to send normal requests from my small java main class to the ISOServer which is able to call my 50_my_server.xml after which the listener class is called to process request.

What am I doing wrong. Your help will be highly appreciated.

 50_my_server.xml
 <server class="org.jpos.q2.iso.QServer" logger="Q2" name="xml-server-7777" realm="xml-server-7777">
<attr name="port" type="java.lang.Integer">7777</attr>
<channel class="org.jpos.iso.channel.ASCIIChannel" packager="org.jpos.iso.packager.GenericPackager" type="server" logger="Q2" realm="xml-server-7777">
<property name="packager-config" value="cfg/customized2.xml" />
<property name="timeout" value="180000"/>
</channel>
<request-listener class="com.my.processor.myListener" logger="Q2" realm="incoming-request-listener" />
</server>


10_mychannel.xml
<?xml version="1.0" encoding="UTF-8"?>
<channel-adaptor name="mychannel-channel" logger="Q2">
<channel class="org.jpos.iso.channel.ASCIIChannel" type="client" connect="yes" logger="Q2" realm="post-channel" packager="org.jpos.iso.packager.GenericPackager">
  <property name="packager-config" value="cfg/customize.xml" />
  <property name="packager-logger" value="Q2" />
  <property name="packager-realm" value="custom-packager" />
  <property name="host" value="XXX.XXX.XXX.XXX" />
  <property name="port" value="7777" />
  <property name="length-digits" value="6" />
  <property name="connection-timeout" value="30000" />
  <property name="timeout" value="300000" />
</channel>
 <in>my-channel-send</in>
 <out>my-channel-receive</out>
 <reconnect-delay>10000</reconnect-delay>
 <keep-alive>yes</keep-alive>
</channel-adaptor>

I also tried adding below to the channel but that also didn't work.

<request-listener class="com.my.processor.myListener" logger="Q2"

Below is a screenshot showing "000000" messages received by the remote iso-server i'm currently connected to. How do i stop sending such messages. I updated the value of the property "length-digits" to 4 and noticed the zeros had reduced to only 4 zeros '0000'. Attempting to comment that particular property threw an exception. Any idea how to handle this

Below is a screenshot showing "000000" messages received by the remote iso-server i'm currently connected to. How do i stop sending such messages

1

There are 1 best solutions below

5
On

If the request is coming from the channel, it's because the other party is sending its requests by that connection instead of the one initiated from it to your server.

If you want to process the incoming request through your channel you can just put a QMUX to process them in a request listener, similar to what you are trying to achieve in your server, e.g. from your other question 20_my_mux.xml:

<?xml version="1.0" ?>

<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="my-mux">
    <in>my-channel-receive</in>
    <out>my-channel-send</out>
    <ready>mychannel-channel.ready</ready>
    <request-listener class="com.my.processor.myListener" logger="Q2" realm="incoming-request-listener" />

</mux>