Complex issue

50 views
Skip to first unread message

James Loveday

unread,
Sep 16, 2022, 5:12:17 AM9/16/22
to jPOS Users
Hi guys, 

I know the heading is a bit mysterious but I'm hoping that somebody can advise here 

So the situation then. 

Jpos sits at the bottom of the stack integrating with a client. 

Communication between the stack and jpos is via JSON/ReST and communication with the client is through TCP/IP. 

We've done this for a number of clients and have no issues so far. 

The issue here is that the client needs to establish the connection with us instead of us establishing it with them. 

So the client needs us to act as the server for them to establish the connection and then act as the client to send the data. 

My understanding is that the TCP/IP socket will allow for 2-way communication as I have seen with other clients, when the connection drops either can re-establish the connection. 

We have a qmux configured to handle outbound and inbound messages. 
We have an incoming message listener set up to handle incoming messages but for some reason the connection cannot be established with us. 

Does anybody have any advice to get over this situation here 

James Loveday

unread,
Sep 16, 2022, 9:45:41 AM9/16/22
to jPOS Users
As a follow up I've implemented a connection listener that fires an echo when a connection has been established but I'm unsure if this will happen when they connect to us or us to them. 

Alejandro Revilla

unread,
Sep 16, 2022, 3:46:50 PM9/16/22
to jpos-...@googlegroups.com
You can add a `connection-listener` to your QServer.

The connection listener allows you to add ISOServerEventListener to your QServer. The ISOServerEventListener has a very simple interface:

public interface ISOServerEventListener {
    void handleISOServerEvent(EventObject event);
}

The event can be an  ISOServerShutdownEvent, ISOServerClientDisconnectEvent, ISOServerAcceptEvent  (you'd be most interested in the latter).

Not sure this is what you need, but perhaps it can come handy.

~



--
--
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/9d3b0d8c-45e2-4820-b7af-1a04ce463ea3n%40googlegroups.com.

James Loveday

unread,
Sep 18, 2022, 1:01:54 PM9/18/22
to jPOS Users

Alejandro 

Just wanted to say a huge thanks for your advice, that is implemented and seems to be working as expected 

Used this page as an example, https://jpos.org/faq/qserver_as_client.html 

Not sure but it would be nice if somebody else finds this solution useful. 

Again many thanks 

Alejandro Revilla

unread,
Sep 18, 2022, 5:20:23 PM9/18/22
to jpos-...@googlegroups.com
Awesome!

Actually, I forgot about that FAQ page when I drew the diagram about using QServer as a client recently.



Reply all
Reply to author
Forward
0 new messages