JPOS integration

883 views
Skip to first unread message

vinod kumar

unread,
Feb 1, 2022, 2:42:33 PM2/1/22
to jPOS Users
Hi Team,

I am trying to understand the jpos, could not get much out of the tutorials available on official site, I can parse java instance to ISO msg but what is Q2 server and why it is required, Cant i just parse using jpos and send the message over through socket from my java application?

Thanks

Alejandro Revilla

unread,
Feb 1, 2022, 3:29:30 PM2/1/22
to jpos-...@googlegroups.com
I suggest you take a look at http://jpos.org/doc/proguide.pdf - there's a whole chapter about Q2.



--
--
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/78e3a710-066e-4a8e-ac66-ba9ada7b4b20n%40googlegroups.com.

vinod kumar

unread,
Feb 1, 2022, 11:27:17 PM2/1/22
to jpos-...@googlegroups.com
Hi Alejandro,

I went through the DOC, im still not understanding it completely.

If you could just point me in the right direction that would be great
 
I understood Q2 is a environment to set up all the jpos components.

I want to know what mux is, channel adaptor and channel is and also the overall flow of how this jpos works on its request, how it processes.


Thanks

Victor Salaman

unread,
Feb 1, 2022, 11:52:52 PM2/1/22
to 'Ruchira Biyani' via jPOS Users
Hi, it would help to know what is your background and what you intend to do with the framework. 

In a nutshell, Q2 is a component inside the jPOS framework. It is an application server specializing in financial transaction management, managing pluggable components and their lifecycle, allowing you to put together an array of services working in harmony. This is analogous to having Spring Boot  or JBoss, only that Q2 was designed from the get-go to serve the needs of the financial/fintech industry.

Channel: In order to communicate with any external system, jPOS provides "channels" that implement the different protocols used most commonly in the  industry (think of sockets with custom behaviour to talk with different systems). 

MUX: Some of these external systems expect a single channel/connection to be established to their system, yet your system serves many devices (e-commerce sessions, POS devices, ATMs, etc). Normally you'd need to have a way of tracking which message response matches the request sent. Fortunately that's exactly what the MUX does.

I can't explain the flow because that will depend on your use case. 

Everything I've just written here is in the user's guide and tutorial, but I hope this helps.

/V

ChannelAdaptor: A ChannelAdaptor is a component within the Q2 server to configure and use a channel within Q2. 




you can configure channels which connect/interface to other

vinod kumar

unread,
Feb 2, 2022, 12:02:55 AM2/2/22
to jpos-...@googlegroups.com
Hi Victor,

Thanks for the detailed response.

My project is a payment gateway, that is from the application(Spring Boot application), ISO msg will be sent to JPOS, jpos needs to capture and send it to the card unions(VISA or Mastercard), capture the response from card union and send the response back to the application.

What would be my setup here? I am trying to set jpos in spring boot.

Thanks


Victor Salaman

unread,
Feb 2, 2022, 12:12:35 AM2/2/22
to 'Ruchira Biyani' via jPOS Users
I would suggest for you the simplest approach is  to run Q2 within Spring  Boot, implementing your core functionality inside Q2 QBeans (components). A negative from this approach is that you would have a complete separation of concerns between the jPOS/Q2 side and the Spring side, therefore you couldn't use Spring Boot resources on the Q2 side or autowiring/etc.

/V

vinod kumar

unread,
Feb 2, 2022, 1:01:48 AM2/2/22
to jPOS Users
From Jpos side, I am using ISORequestListener to listen to requests, How can I post from app side, Can I write a simple socket client and send as shown below, please help


                        socket = new Socket(address, port);
                        System.out.println("Connected");

                        socket = new Socket(address, port);

                        out = new DataOutputStream(socket.getOutputStream());

                                ISOMsg isomsg = new ISOMsg();
                                isomsg.set("1", "4324");
                                out.write((isomsg.getBytes()));
        

                // close the connection
                try
                {
                        input.close();
                        out.close();
                        socket.close();
                }

Victor Salaman

unread,
Feb 2, 2022, 1:07:44 AM2/2/22
to 'Ruchira Biyani' via jPOS Users
Read the programmer's guide supplied by Alejandro, check the examples on Github. Help yourself before anyone can help you. 

/V

Emeka Onwuka

unread,
Feb 2, 2022, 3:52:13 AM2/2/22
to sunday okpokor
Hi Victor 

I thought your chimera project solves this particular issue of auto wiring jpos q2 components with spring, was just taking a look at it today, seems to work fine 



Mark Salter

unread,
Feb 2, 2022, 3:58:16 AM2/2/22
to jpos-...@googlegroups.com
On 02/02/2022 06:06, Victor Salaman wrote:
> Read the programmer's guide supplied by Alejandro, check the examples
> on Github. Help yourself before anyone can help you.

And on top of this excellent advice, Vinod also make sure you carefully
consider your licensing (and support) needs for you ongoing and any
production deployment.

--

Mark

signature.asc

Victor Salaman

unread,
Feb 2, 2022, 4:22:47 AM2/2/22
to 'Ruchira Biyani' via jPOS Users
Hi Emeka:

It would be futile of me to introduce yet another dependency to his project, when he can't understand the programmer's guide. It would be a disfavor for him in his joueney of enlightenment to knock him one level further in the rabbit hole.

/V

Alejandro Revilla

unread,
Feb 2, 2022, 8:48:12 AM2/2/22
to jpos-...@googlegroups.com
Unfortunately I'm not a SpringBoot user but this little Gist may help [partially] integrate with jPOS: https://gist.github.com/ar/86a4a24384d029c35f784079007393b0

As Victor said, you'd probably lose a lot of SB functionality, but at least, you can run Q2 inside it.



vinod kumar

unread,
Feb 3, 2022, 12:28:42 AM2/3/22
to jPOS Users
Hi Team,

i have two jpos running, I am able to connect through mux from jpos env 1 to env 2 and get the response back, but I am not able to get the response through below code

                ISOPackager packager = new Base1Packager();
                ISOChannel channel = new XMLChannel("127.0.0.1", 7006, packager);
                channel.connect();
                System.out.println(channel.isConnected());
                ISOMsg request = new ISOMsg();
                int i = 0;

                BASE1Header head = new BASE1Header();

                head.setFormat(Integer.parseInt("2"));
                head.setSource("808406");
                head.setDestination("000000");

                request.setHeader((ISOHeader) head);
                request.set(i, "0100");
                request.set(i++, "5101281863840909");
                request.set(i++, "000000");
                request.set(i + 3, "0202093321");
                request.set(i + 4, "009001");
                request.set(i + 3, "2202");
                request.set(i + 4, "8211");
                request.set(i + 4, "810");
                request.set(i + 10, "010182");
                request.set(i + 1, "010182");
                request.set(i + 4, "203309009001");
                request.set(i + 4, "45719023");
                request.set(i + 1, "397765775225437");
                request.set(i + 1, "Reliance Fresh         Kar         IND");
                request.set(i + 5, "R2001S420701032106105000016605010119203222");
                request.set(i + 1, "356");
                request.set(i + 12, "10251000060003561100060000");

                channel.send(constructISOMessage(isoMap));
                ISOMsg response = channel.receive();
                System.out.println("response " + response);

Mark Salter

unread,
Feb 3, 2022, 1:24:18 PM2/3/22
to jpos-...@googlegroups.com
Looks like you asked a new question, so better to start a new thread
than continue this one.

On 03/02/2022 05:28, vinod kumar wrote:
> i have two jpos running, I am able to connect through mux from jpos
> env 1 to env 2 and get the response back, but I am not able to get the
> response through below code

Which 'env' is the requester and which is receiving the request and
forming/returning the response?

[snip]
>                 channel.send(constructISOMessage(isoMap));
no MUX here, channel directly?
>                 ISOMsg response = channel.receive();
Do you have anything on the other end of this Channel, to return the
response?

But ask again with this extra needed detail in a *new* thread please.

--

Mark


signature.asc

murtuza chhil

unread,
Feb 7, 2022, 7:20:47 PM2/7/22
to jPOS Users

It would be easier to just set the field with a number instead of doing the i+ math. Its difficult to see which fields are set and you are overwriting fields that you previously set with a new value.
Mux uses field 41+11 (default matching condition) to match requests to responses. If the matching fields don’t match the response ends up in unhandled queue (unsolicited response). The unhandled is part of configuration of a mux. JPOS’ unhandled reads the value from the unhandled queue and dumps it.

<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="banknet14-mux">
...
 <unhandled>xyz-unhandled</unhandled>
...

Unhandled handler deploy

<xyz-unhandled-message class='org.jpos.ee.LogUnhandled' logger='Q2'>
 <property name='unhandled-queue' value='xyz-unhandled' /> <!-- value is the same as the value configured in the mux -->
</xyz-unhandled-message>

-chhil

Reply all
Reply to author
Forward
0 new messages