0

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

Daniel Ameyaw
  • 83
  • 1
  • 10

1 Answers1

2

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>
Andrés Alcarraz
  • 1,570
  • 1
  • 12
  • 21
  • Thank you very much @Andrés Alcarraz, it worked. I however noticed, after starting the q2 server, i had to update the 20_my_mux.xml file (like adding empty space just to update the file) before the requestListener class was able to start receiving incoming requests. Any suggestion on how to start q2 without modifying the 20_my_mux.xml file afterwards. – Daniel Ameyaw Nov 03 '20 at 21:09
  • That may be related to the order things are started, since you are using spring and I'm not familiar with it I cannot give you any pointers. Also, you didn't post the code used to start your system. Q2 will instantiate the request listener at deploy time. Maybe the first deploy occurs previously to the spring wiring and the request lsitener is run but you don't see it because it doesn't interact with your other wired objects. – Andrés Alcarraz Nov 04 '20 at 23:07
  • Any idea on how to stop sending "000000" to the server i'm currently connected to. I have attached a screenshot showing the zeros received by the server i am connected to. Thank you in advance – Daniel Ameyaw Nov 11 '20 at 14:26
  • You need to remove/comment out the `` element or set it to `no` – Andrés Alcarraz Nov 11 '20 at 18:25
  • Thanks Andrés. It worked! Really appreciate your support. – Daniel Ameyaw Nov 11 '20 at 18:50