Re: [jpos-users] Jpos setup

155 views
Skip to first unread message
Message has been deleted

Mark Salter

unread,
May 31, 2024, 2:38:01 AMMay 31
to jpos-...@googlegroups.com

>> This works
Good.

>>   but I think I am in a wrong way.
>>  Can somebody help me and point
>>   where I am wrong.
What do you think is wrong?

If it works, I am sure what you need or are asking?

-- 
Mark

Sent from Proton Mail Android



-------- Original Message --------
On 31/05/2024 07:20, Snehil Khan wrote:
I am new to jpos. Can somebody help me setup jpos. Currently I have VTS simulator as server and here are my qmux, channel adaptor and txn manager.
<?xml version="1.0" encoding="UTF-8"?>
<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="mux1">
<in>receive</in>
<out>send</out>
<ready>channel1.ready</ready>
<request-listener class="org.company.AutoResponder" logger="Q2"
</request-listener>

<request-listener class="org.jpos.iso.IncomingListener" logger="Q2"
realm="incoming-request-listener">
<property name="space" value="transient:default"/>
<property name="queue" value="transaction1"/>
<property name="timeout" value="12000"/>
<property name="ctx.DESTINATION" value="jPOS-AUTORESPONDER" />
</request-listener>
</mux>


<?xml version="1.0" encoding="UTF-8"?>
<channel-adaptor name="channel1" class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2">

<channel class="org.jpos.iso.channel.
ASCIIChannel" logger="Q2"
realm="visa-channel" packager="org.jpos.iso.packager.GenericPackager">
<property name="packager-config" value="/ascii.xml"/>
<property name="host" value="192."/>
<property name="port" value="1111"/>
<property name="timeout" value="300000" /> <!-- five minutes -->
</channel>

<in>send</in>
<out>receive</out>
</channel-adaptor>


<?xml version="1.0" encoding="UTF-8"?>

<txnmgr class="org.jpos.transaction.TransactionManager" logger="Q2">
<property name="space" value="transient:default"/>
<property name="queue" value="transaction1"/>
<property name="persistent-space" value="jdbm:MyTxnSpace" />
<property name="sessions" value="10"/>
<property name="max-sessions" value="128"/>
<property name="timeout" value="5000"/>
<property name="debug" value="true"/>

<participant class="com.wowfinstack.creditswitch.messaging.mux.RouteParticipant" logger="Q2"/>

<participant class="org.jpos.transaction.participant.QueryHost"/>
<participant class="org.jpos.transaction.participant.SendResponse"/>

</txnmgr>

@Override
public boolean process(ISOSource source, ISOMsg isoMsg) {

try {

String spaceN = configuration.get("space");
Long timeout = configuration.getLong("timeout");
String queueN = configuration.get("queue");
Context context = new Context();
Space<String,Context> space = SpaceFactory.getSpace(spaceN);


ISOMsg res = (ISOMsg) isoMsg.clone();
source.send(
res   );

}

}
catch(Exception e) {
e.printStackTrace();
}

return true;
}

public class RouteParticipant implements TransactionParticipant, Configurable {

private static Random rnd = new Random();

private Configuration cfg;

@Override
public void setConfiguration(Configuration configuration) throws ConfigurationException {
this.cfg = cfg;
}

@Override
public int prepare(long id, Serializable serializable) {
Context ctx = (Context) serializable;
try {

System.out.println("-----------Route Participant ----------------------");

ISOMsg m = (ISOMsg) ctx.get(REQUEST);
ISOMsg r = (ISOMsg) m.clone();
r.setResponseMTI();
r.set(39, "00");

// Put the response in the context so we can see in the debug display
ctx.put(RESPONSE, r);
ISOSource source = (ISOSource) ctx.get(SOURCE);
if(source != null && source.isConnected()) {

Thread.sleep(Math.abs(rnd.nextInt() % 4000));
source.send(r);
}

}
catch(Exception e) {
e.printStackTrace();
}

return PREPARED;
}
This works but I think I am in a wrong way. Can somebody help me and point where I am wrong. 

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/a447dca9-80ce-4249-aaa2-5ad56cc0174fn%40googlegroups.com.
signature.asc

Snehil Khan

unread,
May 31, 2024, 1:01:53 PMMay 31
to jPOS Users
This is my log
name-registrar:
tspace:default: org.jpos.space.TSpace
<key count='1'>$TAILLOCK.1759148893</key>
key-count: 1
gcinfo: 0,0
mux.mux1: org.jpos.q2.iso.QMUX
tx=0, rx=0, tx_expired=0, tx_pending=0, rx_expired=0, rx_pending=0, rx_unhandled=0, rx_forwarded=0, connected=false, last=0
transient:default: org.jpos.space.TSpace
<key count='1'>$TAILLOCK.202160828</key>
key-count: 1
gcinfo: 0,0
visa-channel: org.jpos.q2.iso.ChannelAdaptor
tx=0, rx=0, connects=0, last=0
jdbm:MyTxnSpace: org.jpos.space.JDBMSpace
logger.Q2: org.jpos.util.Logger
logger.: org.jpos.util.Logger
mastercard-channel: org.jpos.q2.iso.ChannelAdaptor
tx=0, rx=0, connects=0, last=0
</info>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2024-05-31T11:29:41.987655600">
<info>
start Thread[Thread-9,5,main]
</info>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2024-05-31T11:29:41.987655600">
<info>
start Thread[Thread-13,5,main]
</info>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2024-05-31T11:29:41.987655600">
<info>
start Thread[Thread-12,5,main]
</info>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2024-05-31T11:29:41.987655600">
<info>
start Thread[Thread-11,5,main]
</info>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2024-05-31T11:29:41.988653100">
<info>
start Thread[Thread-10,5,main]
</info>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2024-05-31T11:29:41.988653100">
<info>
start Thread[Thread-18,5,main]
</info>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2024-05-31T11:29:41.988653100">
<info>
start Thread[Thread-17,5,main]
</info>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2024-05-31T11:29:41.988653100">
<info>
start Thread[Thread-16,5,main]
</info>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2024-05-31T11:29:41.988653100">
<info>
start Thread[Thread-15,5,main]
</info>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2024-05-31T11:29:41.988653100">
<info>
start Thread[Thread-14,5,main]
</info>
</log>

Snehil Khan

unread,
May 31, 2024, 1:01:58 PMMay 31
to jPOS Users
Thanks mark for the reply.
I think  space and queue logic is not properly set up


On Friday, May 31, 2024 at 12:23:01 PM UTC+5:45 Mark Salter wrote:

Chandrasekhar Rout

unread,
May 31, 2024, 1:37:01 PMMay 31
to jpos-...@googlegroups.com
I think it's look all  correct  to me . But one things you missed , you have not put request isomsg  in context, after that you have to put that context to space in your requestListner process method  . 
As space is connected to both listener and txnmanager . Then you can get that context and use the request isomsg, process it and then send to client.



Chandrasekhar Rout

unread,
May 31, 2024, 1:44:10 PMMay 31
to jpos-...@googlegroups.com
Also you are missing it in request listener.which connects listener and txnmanager.

 space
.out(queue, context, timeout);

Andrés Alcarraz

unread,
May 31, 2024, 4:01:05 PMMay 31
to jpos-...@googlegroups.com

Sorry, by mistake I sent the last response just to Chandrasekhar. I have to configure thunderbird in this computer for not showing the reply button for lists.

I'm answering to him, but also forwarding this to the list for context and so that my first reply is also delivered.

---

Doesn't the OP have to answer for echo messages anyway?

Also, I have noticed that the OP has two request listeners, there seems to be no need for both if you only need to send an approved response, you can send them in the request listener, or using the transaction manager, but the transaction manager code is not being called if you return true in the first one.

Also, you mey want to check if the request is indeed a request and not a response.

Another question, is your role acquirer or issuer?

Kind regards.


El 31/05/24 a las 14:35, Chandrasekhar Rout escribió:
Alcarraz, if VTS act as server , I think his application is acquirer switch .then he has nothing to do .no need of requestListner, txn manager. Only mux and channel adopter is sufficient. He has to prepare isomsg and sending it through mux and also recieve response from VTS .


On Sat, 1 Jun, 2024, 12:39 am Andrés Alcarraz, <alca...@gmail.com> wrote:

Actually, acording to his configuration he is using the standard jpos’s IncomingListener so what I don’t get, is where’s the process method coming from, perhaps from an unused transaction participant?

As for answering the OP question, I am not sure how to do that, because there is a ton of logic to be added yet, for now you are just approving everything, so you need to add tons of logic for that, and what’s need to be done will depend on tons of things, like requirements and even your personal or the team’s personal tastes.

But you seem to be going down the right track.

My 2 cents.

El 31/05/24 a las 12:43, Chandrasekhar Rout escribió:
--
Andrés Alcarraz

Snehil Khan

unread,
Jun 3, 2024, 2:15:31 AMJun 3
to jPOS Users
public class RequestListener implements ISORequestListener, Configurable {

static QMUX mux;
Configuration cfg;
long timeout 12000;
Space sp;
String queue;


@Override
public void setConfiguration(Configuration configuration) throws ConfigurationException {
this.cfg = configuration;
timeout cfg.getLong("timeout"timeout);
sp = SpaceFactory.getSpace(cfg.get("space"));
queue cfg.get("queue"null);
if (queue == null)
{

throw new ConfigurationException("queue property not specified");


}
}

@Override
public boolean process(ISOSource source, ISOMsg isoMsg) {

try {

Context ctx = new Context();


ISOMsg res = (ISOMsg) isoMsg.clone();
//logic
ISOMsg objResMsg = isoParser.getMessgeObject();
ctx.put(REQUEST  objResMsg  );
ctx.put(SOURCE, source);
sp.out(queue, ctx, timeout);

source.send(
 objResMsg   );


}

}
catch(Exception e) {
e.printStackTrace();
}

return true;
}

Is this the way Chandrasekhar Rout??
Correct me if I am wrong.

chhil

unread,
Jun 3, 2024, 6:33:44 AMJun 3
to jpos-...@googlegroups.com

This is what you had (I removed the auto responder you had in it).

<?xml version="1.0" encoding="UTF-8"?>
<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="mux1">
    <in>
        receive
    </in>
    <out>
        send
    </out>
    <ready>
        channel1.ready
    </ready>
    <request-listener class="org.jpos.iso.IncomingListener" logger="Q2" realm="incoming-request-listener">
        <property name="space" value="transient:default" />
        <property name="queue" value="transaction1" />
        <property name="timeout" value="12000" />
        <property name="ctx.DESTINATION" value="jPOS-AUTORESPONDER" />
    </request-listener>
</mux>

The channel you have is correct (IP is partial but I assume youy were trying to hide it)

<?xml version="1.0" encoding="UTF-8"?>
<channel-adaptor name="channel1" class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2">
    <channel class="org.jpos.iso.channel.ASCIIChannel" logger="Q2" realm="visa-channel" packager="org.jpos.iso.packager.GenericPackager">
        <property name="packager-config" value="/ascii.xml" />
        <property name="host" value="192." />
        <property name="port" value="1111" />
        <property name="timeout" value="300000" />
        <!-- five minutes -->
    </channel>
    <in>
        send
    </in>
    <out>
        receive
    </out>
</channel-adaptor>

The mux and channel in/out queues are aligned correctly.

So anything that comes in will be placed in a space with a queue transaction1.
The listener places a “DESTINATION” key with a value of “jPOS-AUTORESPONDER”

The listener you are using is what jpos provides and is fine https://github.com/jpos/jPOS/blob/master/jpos/src/main/java/org/jpos/iso/IncomingListener.java

So now the transaction manager will start processing the request.

Your first participant in the txn mgr is RouteParticipant

What you do in there is respond back to the source that sent you the ISO request. (source.send(r);)
I don’t think you want to do that since you have a jpos queryhost and jpos SendResponse participants configured.
Your queryhost looks at the “DESTINATION” key in the context (you set the value as “jPOS-AUTORESPONDER” and looks for mux with that name).

You don’t have a mux and channels configured for your outbond, at least you have not shared it here.
If your mux and channel or server was configured queryhost would send the request out, wait for the response (see https://github.com/jpos/jPOS/blob/master/jpos/src/main/java/org/jpos/transaction/participant/QueryHost.java#L83)
Then put the ISO response in the context.

Next the sendResponse participant would get called.
https://github.com/jpos/jPOS/blob/master/jpos/src/main/java/org/jpos/transaction/participant/SendResponse.java#L59
This will do some checks and send the response back to who sent you the request.

Understand what you are trying to configure and do.
Implement the tutorial and understand it.
https://jpos.org/doc/tutorials/jpos-gateway.pdf




-chhil





chhil

unread,
Jun 3, 2024, 6:45:08 AMJun 3
to jpos-...@googlegroups.com

Likely your AsciiChannel for Visa is incorrect.
You will most likely need https://github.com/jpos/jPOS/blob/master/jpos/src/main/java/org/jpos/iso/channel/VAPChannel.java

<channel-adaptor name='visa_xxx' 
    class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2" realm="visaxxx">
    <channel name="visachannel.1"
          class="org.jpos.iso.channel.VAPChannel"
          packager="org.jpos.iso.packager.GenericPackager" logger="Q2" realm="visa.channel.1">
        <property name="packager-config" value="path/to/visasms.xml" />
        <property name="srcid" value="@srcid-1@" />
        <property name="dstid" value="@destid-1@" />
        <property name="host" value="@IP To connect to VTS@" />
        <property name="port" value="@port VTS is listening on@" />

    </channel>
    <ignore-iso-exceptions>yes</ignore-iso-exceptions>

    <in>send</in>
    <out>receive</out>

</channel-adaptor>

Snehil Khan

unread,
Jun 3, 2024, 8:02:37 AMJun 3
to jPOS Users
Hello chhil, I got this error now. I got outgoing response (0110) still it indicate as fail txn. Does that mean this response will not proceed to scheme(vi or mc)?

    RESULT:
<result>
<fail>
[MISCONFIGURED_ENDPOINT] o.j.t.p.QueryHost.prepare:62 'DESTINATION' not present in Context
</fail>
</result>

</context>
prepare: o.j.t.p.QueryHost ABORTED READONLY NO_JOIN
prepareForAbort: o.j.t.p.SendResponse
in-transit=0/0, head=2, tail=2, paused=0, outstanding=0, active-sessions=10/128, tps=0, peak=0, avg=0.00, elapsed=10ms
<profiler>
prepare: o.j.t.p.QueryHost [9.3/9.3]
prepareForAbort: o.j.t.p.SendResponse [0.5/9.8]
end [2.0/11.9]
</profiler>
</abort>
</log>

chhil

unread,
Jun 3, 2024, 9:15:51 AMJun 3
to jpos-...@googlegroups.com



prepare: o.j.t.p.QueryHost ABORTED READONLY NO_JOIN
prepareForAbort: o.j.t.p.SendResponse
Its telling you there was a problem with queryhost. 
What is the probleme
[MISCONFIGURED_ENDPOINT] o.j.t.p.QueryHost.prepare:62 'DESTINATION' not present in Context
At line 62 of QueryHost when the participant tries to get the mux using the value of context key "DESTINATION" , the mux is not found means you have not configured the mux to send the message forward.
In my previous response I had mentioned I did not see the mux and channel configured to send the request out.
So debug your code, see if the listener is putting a key called "DESTINATION" in your context when it puts the context on the txn mgr queue transaction1

Put a breakpoint in https://github.com/jpos/jPOS/blob/master/jpos/src/main/java/org/jpos/transaction/participant/SendResponse.java and see what it is doing when the request could not get sent out and what it does for the response to be sent back.

-chhil





Andrés Alcarraz

unread,
Jun 3, 2024, 10:11:36 AMJun 3
to jpos-...@googlegroups.com

That “ implementation has some weird stuff:

ISOMsg res = (ISOMsg) isoMsg.clone();
//logic
ISOMsg objResMsg = isoParser.getMessgeObject();
ctx.put(REQUEST,   objResMsg  );
ctx.put(SOURCE, source);
sp.out(queue, ctx, timeout);

source.send( objResMsg   );

You are putting the request in a context, and then queueing it to be processed by a transaction manager, but you are sending a bad response in the same method.

Your source.send( objResMsg ); will send the request back to the sender without any processing, and usually you send the response in the transaction manager. I suggest you go through the jPOS gateway tutorials before continuing, so you understand better what you are doing.

Andrés Alcarraz

Snehil Khan

unread,
Jun 3, 2024, 11:37:12 AMJun 3
to jPOS Users
I did not see the mux and channel configured to send the request out.
I dont get it. How can we configure. Can you provide some references.

Snehil Khan

unread,
Jun 3, 2024, 11:43:53 AMJun 3
to jPOS Users
Right now the configuration looks like this. 
ISOMsg res = (ISOMsg) isoMsg.clone(); Parse isoParser  = processRequest.process(res); 
//All the validation are done inside process. So isoParser is response  ISOMsg objResMsg   = isoParser.getMessgeObject();
ctx.put(REQUEST, res);
ctx.put(SOURCE, source);
ctx.put(RESPONSE, objResMsg);
sp.out(queue, ctx, timeout);


//the response
o.j.t.ContextConstants.SOURCE: org.jpos.iso.channel.VAPChannel@59c939f3
o.j.t.ContextConstants.RESPONSE:
<isomsg direction="incoming">
<!-- org.jpos.iso.packager.GenericPackager[packager/iso87Binary.xml] -->
<header>16010200CD0000000000000000000000000000000000</header>
<field id="0" value="0110"/>
<field id="2" value="XXXXXXXXXXXXXXXX"/>
<field id="3" value="003000"/>
<field id="4" value="000000000100"/>
<field id="7" value="0603152859"/>
<field id="14" value="2905"/>
<field id="18" value="5661"/>
<field id="49" value="356"/>
<field id="55" value="" type="binary"/>
<field id="60" value="0000000008" type="binary"/>
<isomsg id="62">
<!-- org.jpos.iso.packager.GenericSubFieldPackager -->
<field id="1" value="W"/>
<field id="2" value="031415507139439"/>
</isomsg>
<isomsg id="126">
<!-- org.jpos.iso.packager.Base1SubFieldPackager -->
<field id="10" value="11333 "/>
</isomsg>
</isomsg>


RESULT:
<result>
<fail>
[MISCONFIGURED_ENDPOINT] o.j.t.p.QueryHost.prepare:62 'DESTINATION' not present in Context
</fail>
</result>

</context>
prepare: o.j.t.p.QueryHost ABORTED READONLY NO_JOIN
prepareForAbort: o.j.t.p.SendResponse
in-transit=0/0, head=2, tail=2, paused=0, outstanding=0, active-sessions=10/128, tps=0, peak=0, avg=0.00, elapsed=29ms
<profiler>
prepare: o.j.t.p.QueryHost [28.5/28.5]
prepareForAbort: o.j.t.p.SendResponse [0.9/29.5]
end [5.8/35.3]
</profiler>
</abort>

Andrés Alcarraz

unread,
Jun 3, 2024, 11:56:59 AMJun 3
to jPOS Users
The jpos gateway tutorials http://www.jpos.org/tutorials are the references you seek.

----
Enviado desde mi móvil, disculpas por la brevedad.

Sent from my cellphone, I apologize for the brevity.

Andrés Alcarraz.

chhil

unread,
Jun 3, 2024, 12:03:06 PMJun 3
to jpos-...@googlegroups.com
Provide a system diagram with your servers clients and where jpos sits.

If you haven't gone through the programmers guide please do that


Then go through the tutorials



-chhil

Snehil Khan

unread,
Jun 3, 2024, 1:19:31 PMJun 3
to jpos-...@googlegroups.com
Right now flow looks goes like this 
When the code runs, first q2 is deployed then signon request is set where the request is sent to server for 0800 connection. After the connection with server(vts) is successful, iso msg(0100) is sent from vts . It dorectly goes to IsoRequestListener class as shown below

Override
public boolean process(ISOSource source, ISOMsg isoMsg) {

try {

ISOMsg res = (ISOMsg) isoMsg.clone(); Parse  isoParser  = processRequest.process(res); 
//All the card validation are done inside process. So isoParser is response  ISOMsg  objResMsg   = isoParser.getMessgeObject();
ctx.put(REQUEST, res);
ctx.put(SOURCE, source);
ctx.put(RESPONSE, objResMsg);
sp.out(queue, ctx, timeout

}

}

catch(Exception e) {
e.printStackTrace();
}

return true;
}


this is where i have set everything.
I havent used QServer as I thought it as a server.
I have qmux, channel, txn manager, sysmonitor and logger in my deploy file. I think I got a liitle idea from document you provided. But still confused whether to use Qserver or not ??? From the document view QServer must be used. 

chhil

unread,
Jun 3, 2024, 8:14:10 PMJun 3
to jpos-...@googlegroups.com
So VTS is a server and you are a client so you use a mux +channel adaptor. You have that working. 

Then the request is put on the transaction manager. 
Txn mgr processes it participant by participant as configured in your txn mgr deploy XML. 

Your txn mgr calls a queryhost participant. This participant sends the request forward to the entity you are connected to. 
This entity can be a TCP server or client. If it's a server then like what you did for vts , it will need a mux+ channel adaptor. If the entity is a client and you are a server, you need a mux + qserver deployed. 

Queryhost will use the mux name to find the deployed mux and send the request. 

-chhil


chhil

unread,
Jun 3, 2024, 10:10:21 PMJun 3
to jpos-...@googlegroups.com
What you did was replace the jpos IncomingListener with your RequestListener, which is fine, but you removed the functionality that the jpos one provided of copying the destination mux name to the context

https://github.com/jpos/jPOS/blob/master/jpos/src/main/java/org/jpos/iso/IncomingListener.java#L59-L65 (you have rewritten this, unless the existing one does not meet your needs there is no need to rewrite it).

These additional context constants are defined using the ctx.<constant> in the configuration.

Either mimic the jpos listener or write yours that fulfills the configurations that need to be setup so that the jpos participants can find them and use them.

You pretty much had it working with the initial setup except for a few issues I had pointed out in my initial response.
1. Issue in your route participant that was sending the response back using source.send(...)
2. Did not have a mux and channel/server configured/defined for destination.
<property name="ctx.DESTINATION" value="jPOS-AUTORESPONDER" />
here jPOS-AUTORESPONDER is the mux name and you need to define the mux and client channel/server for it.

-chhil

Snehil Khan

unread,
Jun 4, 2024, 1:34:20 AMJun 4
to jPOS Users
I think I got what was wrong by observing your answers. Firstly I have set RequestListener in my mux file due to which first it goes to RequestListener class and process the request and response(to be sent to visa). After that space will send the request to txn manager. I think due to this I got the issue. I have to make seperate class that handles the response to be sent to visa. Is that so ???
I have removed  route participant class and by  (2. Did not have a mux and channel/server configured/defined for destination) you mean I have to make another mux and channel for destination as I already have one ??

public class RequestListener implements ISORequestListener, Configurable {

static QMUX mux;
Configuration cfg;
long timeout = 12000;
Space sp;
String queue;

@Override
public void setConfiguration(Configuration configuration) throws ConfigurationException {
this.cfg = configuration;
timeout = cfg.getLong("timeout", timeout);
sp = SpaceFactory.getSpace(cfg.get("space"));
queue = cfg.get("queue");
if(queue == null) {


throw new ConfigurationException("queue property not specified");

}
}

@Override
public boolean process(ISOSource source, ISOMsg isoMsg) {

try {

Context ctx = new Context();
ISOMsg res = (ISOMsg) isoMsg.clone();

if("0800".equals(isoMsg.getMTI())) {

System.out.println("---------- network response");
res.set(39, cfg.get("rc", "00"));
source.send(res);

}
else {
ISOParse 
objParse = new  ISOParse();
objParse = ProcessReq.processReq( objParse);  //data populate and card validation are done inside

ISOMsg objResMsg = 
objParse.getMsgObject();

ctx.put(REQUEST
isoMsg  );  // request
ctx.put(SOURCE, source);
ctx.put(RESPONSE, objResMsg); //response sent 
sp.out(queue, ctx, timeout);

Snehil Khan

unread,
Jun 4, 2024, 1:42:44 AMJun 4
to jPOS Users
This is my mux class now and I have removed RouteParticipant from txn manager

<?xml version="1.0" encoding="UTF-8"?>
<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="mux1">
<in>receive</in>
<out>send</out>
<ready>channel1.ready</ready>

<request-listener class="org.company. RequestListener logger="Q2"
realm="incoming-request-listener">
<property name="space" value="transient:default"/>
<property name="queue" value="transaction1"/>
<property name="timeout" value="12000"/>
<property name="ctx.DESTINATION" value="jPOS-AUTORESPONDER" />
</request-listener>
</mux>



chhil

unread,
Jun 4, 2024, 2:02:12 AMJun 4
to jpos-...@googlegroups.com

Follow the numbers and see which components are needed.
See which components you have deployed and which you haven't according to my understanding of what you are trying to do.
Your code snippets are unreadable due to markup coloring.

image.png

Andrés Alcarraz

unread,
Jun 4, 2024, 9:02:04 AMJun 4
to jpos-...@googlegroups.com

Hi Snehil.

To help you better, we need to understand more about what you are trying to achieve, perhaps you already stated that, but it may have lost to me between all the code fragments.

What do you need to do with the incoming messages? Who performs the authorization? Yourself or you have to send it to another party for authorization?

All those details will determine what you do in your transaction manager.

That said, I would suggest not performing any logic in a custom request listener and just use IncomingListener , you may respond to the 0800’s in a request listener, and then let the IncomingListener send all the other messages to the transaction manager.

The following code makes me think you still need to understand jPOS concepts to be able to effectively develop a jPOS based application:

Your ISORequestListener would look something like this:

public class EchoRequestListener implements ISORequestListener {
    
@Override
    public boolean process(ISOSource source, ISOMsg isoMsg)
 {
        if("0800".equals(isoMsg.getMTI())) {
            ISOMsg res = (ISOMsg) isoMsg.clone();
            res.set(39, cfg.get("rc", "00"));
            source.send(res);
            return true;
        } else {
            return false; //so that the next request listener process the message
        }
    }
}

Then in your server xml:

<?xml version="1.0" encoding="UTF-8"?>
<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="mux1">
    <in>receive</in>
    <out>send</out>
    <ready>channel1.ready</ready>


    <request-listener class="org.company.EchoRequestListener"/> <!--process echo messages-->
    <request-listener class="org.jpos.iso.IncomingListener"  realm="incoming-request-listener" logger="Q2">

        <property name="space" value="transient:default"/>
        <property name="queue" value="transaction1"/>

        <property name="timeout" value="12000"/>
        <property name="ctx.DESTINATION" value="jPOS-AUTORESPONDER" /> <!-- do you really want to send your request to the jPOS autoresponder?-->
    </request-listener>
</mux>

And perform any other logic in a custom participant.

I hope this will put you closer to your goal.

Andrés Alcarraz

Snehil Khan

unread,
Jun 4, 2024, 12:42:17 PMJun 4
to jPOS Users
I myself perform authorization.  With the incoming iso message I do some validation and other stuffs and need to send the response to respective acquirers or visas.
How do I send the response to visas? Do I need to make custom participant in txn manager. I think I am on close call.

Message has been deleted
Message has been deleted

Snehil Khan

unread,
Jun 5, 2024, 3:43:22 AMJun 5
to jPOS Users
This is what I got . Would you mind briefing how can I handle incoming iso message to send response to visas ?? I have removed jpos-AUTORESPONDER and implementd RouteParticipant in txn manager. 

<log realm="visa.channel.1/192.XXX.X.XX:XXXX" at="2024-06-05T13:19:50.838408800">
<send>
<isomsg direction=" ">
<!-- org.jpos.iso.packager.GenericPackager[packager/visa1.xml] -->
<header>160101003E0000000000000000000000000000000000</header>
<field id="0" value="0800"/>
<field id="7" value="0605011947"/>
<field id="11" value="574270"/>
<field id="37" value="400501574270"/>
<field id="70" value="071"/>
</isomsg>
</send>
</log>
<log realm="visa.channel.1/192.XXX.X.XX:XXXX" at="2024-06-05T13:19:55.204448500" lifespan="6894ms">
<receive>
<isomsg direction="incoming">
<!-- org.jpos.iso.packager.GenericPackager[packager/visa1.xml] -->
<header>16010200CD0000000000000000000000000000000000</header>
<field id="0" value="0100"/>
<field id="2" value="444400XXXXXXXXXX"/>

<field id="3" value="003000"/>
<field id="4" value="000000000100"/>
<field id="7" value="0605073455"/>
<field id="11" value="004475"/>

<field id="14" value="2905"/>
<field id="32" value="00000123456"/>
<field id="37" value="415707004475"/>

<field id="49" value="356"/>
</isomsg>
</receive>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2024-06-05T13:19:55.209437600" lifespan="1ms">
<commit>
txn_manager-visa-4:idle:1
<context>
TIMESTAMP: Wed Jun 05 13:19:55 2024
SOURCE: org.jpos.iso.channel.VAPChannel@33bceaf
REQUEST:
<isomsg direction="incoming">
<!-- org.jpos.iso.packager.GenericPackager[packager/visa1.xml] -->
<header>16010200CD0000000000000000000000000000000000</header>
<field id="0" value="0100"/>
<field id="2" value="444400XXXXXXXXXX"/>

<field id="3" value="003000"/>
<field id="4" value="000000000100"/>
<field id="7" value="0605073455"/>
<field id="11" value="004475"/>

<field id="14" value="2905"/>
<field id="32" value="00000123456"/>
<field id="37" value="415707004475"/>

<field id="49" value="356"/>
</isomsg>

</context>
prepare: c.w.c.m.m.RouteParticipant PREPARED READONLY
commit: c.w.c.m.m.RouteParticipant
in-transit=0/0, head=2, tail=2, paused=0, outstanding=0, active-sessions=10/128, tps=0, peak=0, avg=0.00, elapsed=1ms
<profiler>
prepare: c.w.c.m.m.RouteParticipant [0.3/0.3]
commit: c.w.c.m.m.RouteParticipant [0.7/1.0]
end [1.7/2.8]
</profiler>
</commit>
</log>

chhil

unread,
Jun 5, 2024, 6:19:52 AMJun 5
to jpos-...@googlegroups.com
Is VTS supposed to send a request, and are you supposed to turn around the message and respond to VTS?

VTS -->0100 Req---> JPOS App
VTS <--0110 Res<--- JPOS APP

-chhil

Snehil Khan

unread,
Jun 5, 2024, 6:37:24 AMJun 5
to jPOS Users


-----I have used RouteParticipant to handle incoming iso message. And this is what I got. Is this correct ??



<log realm="visa.channel.1/192.XXX.X.XX:XXXX" at="2024-06-05T16:07:28.485530500" lifespan="149036ms">

<receive>
<isomsg direction="incoming">
<!-- org.jpos.iso.packager.GenericPackager[packager/visa1.xml] -->
<header>16010200CD0000000000000000000000000000000000</header>
<field id="0" value="0100"/>
<field id="2" value="
444400XXXXXXXXXX"/>

<field id="3" value="003000"/>
<field id="4" value="000000000100"/>
<field id="7" value="0605102228"/>

<field id="14" value="2905"/>
<field id="32" value="00000123456"/>
<field id="37" value="415710004495"/>

<field id="49" value="356"/>
</isomsg>
</receive>
</log>
<log realm="visa.channel.1/192. XXX.X.XX:XXXX  " at="2024-06-05T16:07:28.486707900">
<send>
<isomsg direction="outgoing">
<!-- org.jpos.iso.packager.GenericPackager[packager/
visa1.xml] -->
<header>16010200CF0000000000000000000000000000000000</header>

<field id="0" value="0110"/>
<field id="2" value="444400XXXXXXXXXX"/>
<field id="3" value="003000"/>
<field id="4" value="000000000100"/>
<field id="7" value="0605102228"/>

<field id="14" value="2905"/>
<field id="32" value="00000123456"/>
<field id="37" value="415710004495"/>
<field id="39" value="00"/>            //response 

<field id="49" value="356"/>

</isomsg>
</send>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2024-06-05T16:07:28.487704700" lifespan="1ms">
<commit>
txn_manager-visa-5:idle:2
<context>
TIMESTAMP: Wed Jun 05 16:07:28 2024
SOURCE: org.jpos.iso.channel.VAPChannel@25b4e7a5

REQUEST:
<isomsg direction="incoming">
<!-- org.jpos.iso.packager.GenericPackager[packager/
visa1.xml] -->

<header>16010200CD0000000000000000000000000000000000</header>
<field id="0" value="0100"/>
<field id="2" value="444400XXXXXXXXXX"/>
<field id="3" value="003000"/>
<field id="4" value="000000000100"/>
<field id="7" value="0605102228"/>

<field id="14" value="2905"/>
<field id="32" value="00000123456"/>
<field id="37" value="415710004495"/>

<field id="49" value="356"/>

</isomsg>

o.j.t.ContextConstants.RESPONSE:
<isomsg direction="outgoing">
<!-- org.jpos.iso.packager.GenericPackager[packager/visa1.xml] -->
<header>16010200CF0000000000000000000000000000000000</header>
<field id="0" value="0110"/>
<field id="2" value="444400XXXXXXXXXX"/>
<field id="3" value="003000"/>
<field id="4" value="000000000100"/>
<field id="7" value="0605102228"/>

<field id="14" value="2905"/>
<field id="32" value="00000123456"/>
<field id="37" value="415710004495"/>
<field id="39" value="00"/>            //response 

<field id="49" value="356"/>
</isomsg>
</isomsg>

</context>
prepare: c.w.c.m.m.RouteParticipant2 PREPARED READONLY
commit: c.w.c.m.m.RouteParticipant2
in-transit=0/0, head=3, tail=3, paused=0, outstanding=0, active-sessions=10/128, tps=0, peak=1, avg=0.00, elapsed=1ms
<profiler>
prepare: c.w.c.m.m.RouteParticipant2 [1.3/1.3]
commit: c.w.c.m.m.RouteParticipant2 [0.1/1.5]
end [0.9/2.4]
</profiler>
</commit>

chhil

unread,
Jun 5, 2024, 7:26:08 AMJun 5
to jpos-...@googlegroups.com
Please try responding to questions and not posting logs. 
You should be able to determine whether it's correct or incorrect based on what you are trying to achieve. If you cannot say whether your log is correct or incorrect, how do you expect me to tell you that, as I have no idea what you are trying to achieve?
I have asked multiple times to explain the message flow of your system, and you have not replied to them, and you continue posting logs. There is not much I can do to help you until I have information from you to help you.
And when you do post logs please try without markup as its unreadable.

Andrés Alcarraz

unread,
Jun 5, 2024, 10:39:15 AMJun 5
to jpos-...@googlegroups.com

Hi Sneil, if you want to successfully implement a jPOS (or any other technology) based solution, you need to understand what is happening without asking in every step to the community, or else, it will take you ages, if it even finally works.

Your questions should be about what specifically you don’t understand from the logs or workflow, but not for us to tell you if it is OK or not because we don’t even know the specifics. Also, it is boring reading logs for others, unless we are trying to solve some interesting problem; and telling you if it is OK is not an interesting problem.

So, this is the last time I’m going to do this.

According to the log, you sent a reply approving the request:

<log realm="visa.channel.1/192.  XXX.X.XX:XXXX  " at="2024-06-05T16:07:28.486707900">
  <send>
    <isomsg direction="outgoing">
      <!-- org.jpos.iso.packager.GenericPackager[packager/visa1.xml] -->
      <header>16010200CF0000000000000000000000000000000000</header>
      <field id="0" value="0110"/>
<field id="2" value="444400XXXXXXXXXX"/>
<field id="3" value="003000"/>
<field id="4" value="000000000100"/>
<field id="7" value="0605102228"/>
<field id="14" value="2905"/>
<field id="32" value="00000123456"/>
<field id="37" value="415710004495"/> <field id="39" value="00"/>            //response 
<field id="49" value="356"/>
    </isomsg>
  </send>
</log>

If everything matches, the VTS should have received the response. If it didn’t, there is most probably something wrong with the header, if it did, I don’t understand why you are asking since you should have seen it there.

So, next time, please try to make sense of the logs, and what you don’t understand.

Andrés Alcarraz
On 5/6/24 05:37, Snehil Khan wrote:


-----I have used RouteParticipant to handle incoming iso message. And this is what I got. Is this correct ??

<log realm="visa.channel.1/192. XXX.X.XX:XXXX  " at="2024-06-05T16:07:28.48670790<log realm="visa.channel.1/192. XXX.X.XX:XXXX  " at="2024-06-05T16:07:28.486707900">
<send>
<isomsg direction="outgoing">
<!-- org.jpos.iso.packager.GenericPackager[packager/
visa1.xml] --><log realm="visa.channel.1/192. XXX.X.XX:XXXX  " at="2024-06-05T16:07:28.486707900">
visa1.xml] -->

Mark Salter

unread,
Jun 5, 2024, 11:31:34 AMJun 5
to jpos-...@googlegroups.com
On 05/06/2024 15:38, Andrés Alcarraz wrote:
According to the log, you sent a reply approving the request:

I see a response, but expect VTS disliked it - no response code (as a for instance).


Time for the OP to share what they are trying to do in what role - otherwise we are configuring a jpos instance on a mailing list - blindly :-D


--

Mark

signature.asc

Andrés Alcarraz

unread,
Jun 5, 2024, 11:33:46 AMJun 5
to jPOS Users
Sorry I did see a 39 data element in the response in the transaction log, and didn't check in this fragment.


----
Enviado desde mi móvil, disculpas por la brevedad.

Sent from my cellphone, I apologize for the brevity.

Andrés Alcarraz.
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage.  Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.

Mark Salter

unread,
Jun 5, 2024, 12:19:32 PMJun 5
to jpos-...@googlegroups.com

No need to apologise! We now just need the OP to share their intentions.

-- 
Mark



-------- Original Message --------
signature.asc

murtuza chhil

unread,
Jun 6, 2024, 1:21:32 AMJun 6
to jPOS Users
I too missed seeing 39 initially and checked again before responding to the thread and stopped. Its there.


<field id="37" value="415710004495"/> <field id="39" value="00"/>

So VTS received it.  Everything else is a mystery.

-chhil
 

Mark Salter

unread,
Jun 6, 2024, 4:35:04 AMJun 6
to jpos-...@googlegroups.com

Without de38, vts still wont like it.
I agree though, over to Snehil to share the details and information already requested but not given.

-- 
Mark



-------- Original Message --------
signature.asc
Reply all
Reply to author
Forward
0 new messages