Jpos server disconnect intimation to JPOS client

77 views
Skip to first unread message

Amit Vadje

unread,
May 24, 2017, 8:51:07 AM5/24/17
to jPOS Users
Hi,

We have one async jpos client and jpos server program. Jpos client sends the request to server using QMUX in async manner. How can we identify whether request is sent successfully to server or not in JPOS client if JPOS server is not started/disconnected?
As we received response message as NULL in JPOS client for JPOS server timeout or disconnected/not started case.


Thanks,
Amit

Andrés Alcarraz

unread,
May 24, 2017, 9:01:26 AM5/24/17
to jpos-...@googlegroups.com

You can call mux.isConnected() before trying. That works if you have set de ready property as in the next example borrowed from the excellent must read jpos programmer's guide:

<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="mymux">
 <in>your-channel-receive</in>                               (1)
 <out>your-channel-send</out>                                (2)
 <ready>your-channel.ready</ready>                           (3)
</mux>

(3) In order to provide a usable MUX.isConnected() method, the MUX needs to have a way to know if the underlying channel, loosely connected through the in/out queues is actually connected. The channel adaptor sets an entry in the space named after the channel’s name with the extension .ready as true when connected, so the optional ready element has to match that name. If a <ready> element isn’t present, MUX.isConnected() will always return true.

Hope this helps

Andrés Alcarraz

El 24/05/17 a las 09:51, Amit Vadje escribió:
--
--
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 post to this group, send email to jpos-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/87353b89-99ea-4527-baa5-72f2cd4a979c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrés Alcarraz

unread,
May 24, 2017, 9:01:41 AM5/24/17
to jpos-...@googlegroups.com

Hi Amit:

You can call mux.isConnected() before trying. That works if you have set de ready property as in the next example borrowed from the excellent must read jpos programmer's guide:

<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="mymux">
 <in>your-channel-receive</in>                               (1)
 <out>your-channel-send</out>                                (2)
 <ready>your-channel.ready</ready>                           (3)
</mux>

(3) In order to provide a usable MUX.isConnected() method, the MUX needs to have a way to know if the underlying channel, loosely connected through the in/out queues is actually connected. The channel adaptor sets an entry in the space named after the channel’s name with the extension .ready as true when connected, so the optional ready element has to match that name. If a <ready> element isn’t present, MUX.isConnected() will always return true.

Hope this helps

Andrés Alcarraz

El 24/05/17 a las 09:51, Amit Vadje escribió:
Hi,

Amit Vadje

unread,
May 25, 2017, 7:13:05 AM5/25/17
to jPOS Users
Hi Andres,

Thanks a lot. Using this setting we are able to verify the channel is connected or not.


Thanks,
Amit
Reply all
Reply to author
Forward
0 new messages