using QMUX

1,158 views
Skip to first unread message

Prajakta S

unread,
Apr 21, 2008, 7:39:06 AM4/21/08
to jPOS Users
Hi All,
I have configured Q2 to use QMUX in the following manner:
<?xml version="1.0" ?>

<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="myMux">
<in>sample-receive</in>
<out>sample-send</out>

<channel name="channel" class="org.jpos.iso.channel.ASCIIChannel"
logger="Q2"
realm="channel" timeout="600000"
packager="org.jpos.iso.packager.GenericPackager">
<property name="host" value="127.0.0.1"/>
<property name="port" value="8000" />

</channel>

</mux>
----------
In the test class, I am following the steps below:
1.Start Q2
2.Construct an ISOMsg and use QMUX to send/receive response.
ISOMsg m = new ISOMsg ();
m.setMTI ("0800");
m.set (3, "000000");
m.set (11, "000001");
m.set(32,"09660110110");
m.set (41, "3239313130303031");
QMUX mux = (QMUX) NameRegistrar.get ("mux.myMux");
ISOMsg resp = mux.request(m, 3000);

However,the response I am getting "resp" is null.

I debugged the "request" method and found that the entry being put in
space,
is later not retrieved.
resp = (ISOMsg) sp.rd (key, timeout); returns null.

Am I missing out anything?

Thanks,
Prajakta

Prajakta S

unread,
Apr 21, 2008, 7:46:29 AM4/21/08
to jPOS Users
Hi All,

I am using QMUx in combination with Q2.My Q2 config file looks like
this
<?xml version="1.0" ?>

<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="myMux">
<in>sample-receive</in>
<out>sample-send</out>

<channel name="channel" class="org.jpos.iso.channel.ASCIIChannel"
logger="Q2"
realm="channel" timeout="600000"
packager="org.jpos.iso.packager.GenericPackager">
<property name="host" value="127.0.0.1"/>
<property name="port" value="8000" />

</channel>

</mux>
----------
My test file has following code:
1)Start Q2
2) Construct ISOMsg and send it to QMUX
ISOMsg m = new ISOMsg ();
m.setMTI ("0800");
m.set (3, "000000");
m.set (11, "000001");
m.set(32,"09660110110");
m.set (41, "3239313130303031");
QMUX mux = (QMUX) NameRegistrar.get ("mux.myMux");
ISOMsg resp = mux.request(m, 0);

However,the response,"resp" ,I am getting is null.

I tried debugging the code,in the "request" method....
the ISOMsg is written out in space..but returns null for following
line..
resp = (ISOMsg) sp.rd (key, timeout);

Mark Salter

unread,
Apr 21, 2008, 8:17:57 AM4/21/08
to jPOS Users


On Apr 21, 12:46 pm, Prajakta S <prajaktas...@gmail.com> wrote:
> ISOMsg resp =   mux.request(m, 0);
>
> However,the response,"resp" ,I am getting is null.
On a timeout, although I am not sure of the affect a timeout of 0!
It was 3000 (3 seconds) in your previous posting.

>
> I tried debugging the code,in the "request" method....
> the ISOMsg is written out in space..but returns null for following
> line..
>   resp = (ISOMsg) sp.rd (key, timeout);
For QMUX to return the response *matching* the request, it needs to
know which fields are always identical between the request and
response.

Are you seeing a response back over the Channel at all?

A QMUX by default uses DE11 and DE41 as the matching key, do these
fields match in both your request and response?

You can override the fields used by specifying :-

<key>x,y,z</key>

Watch your key field padding and ensure that any key fields in your
request are set in full. I think the values are taken pre-packing and
thus (currently) padding.

--
Mark

Prajakta S

unread,
Apr 21, 2008, 8:33:56 AM4/21/08
to jPOS Users
Hi Mark,

I was not able to see my posted mssg initially on the google grps ,so
I reposted it.
I tried out with timeout 0 and 3000 both,resp was null.
Secondly,I didn't get the meaning of:
>>>>A QMUX by default uses DE11 and DE41 as the matching key, do these
fields match in both your request and response?
>>>You can override the fields used by specifying :-


<key>x,y,z</key>


I tried putting:
<key>11</key> in the config XML.is that the right way?

my response does have DE11 with same value.

but still getting null response.

Thanks,
Prajakta

Alejandro Revilla

unread,
Apr 21, 2008, 8:34:03 AM4/21/08
to jpos-...@googlegroups.com
This looks like a QSP configuration where the channel can go inside the
MUX. In Q2, you need two different configurations, one for the QMUX and
one for the ChannelAdaptor. I suggest that you have a look at jPOS-EE's
clientsimulator (and eventually serversimulator) where we define both and
you can use them as a sample.

You can use the clientsimulator and serversimulator modules in jPOS,
just place them in the 'modules' directory, no need for jPOS-EE.

chhil

unread,
Apr 21, 2008, 10:13:30 AM4/21/08
to jpos-...@googlegroups.com
In order to match requests to responses you need to use fields that have values that are echoed back.
So by default field11 +field41 is used which is generally echoed back in the response.
The overriding behavior to get finer granularity and to prevent the roll over effect (macthing an incorrect transaction) of the matching criteria or simply that field 11 and 41 are not echoed back.

Search the list to see for how you can log the response to see if data is coming back and if the fields contain the matching information.

-chhil

Prajakta S

unread,
Apr 21, 2008, 11:22:19 AM4/21/08
to jPOS Users
Hi,
We are still facing difficulty in getting on to the jPOSEE source,it
prompts for username/password.
While we are exploring that option ,is there any other way of using
QMUX...
I have asked thin question in my other post too..
how do we collectively embed QMUX,channel,packager ..?
Should we have two different configuration files, one for the QMUX
and
one for the ChannelAdaptor ?
If yes,then how would they be linked and how to use them in the code?

Thanks,
Prajakta
> > > Mark- Hide quoted text -
>
> - Show quoted text -

Mark Salter

unread,
Apr 21, 2008, 2:33:54 PM4/21/08
to jpos-...@googlegroups.com
Prajakta S wrote:
> Hi,
> We are still facing difficulty in getting on to the jPOSEE source,it
> prompts for username/password.
That thread stopped with me asking if you had a proxy and if that needed
a userid/password as tortoisesvn was asking me for a userid/password.
I also asked you to confirm the url you were using.

No replies, but ...

> how do we collectively embed QMUX,channel,packager ..?
> Should we have two different configuration files, one for the QMUX
> and
> one for the ChannelAdaptor ?
> If yes,then how would they be linked and how to use them in the code?

Quick/rough answer :- the method varies with the environment.

May I suggest we address your first problem - not be able to download
jpos-ee? At least then you can use jpos-ee and things should be easier.

So...

You are using TortoiseSVN on windows, yes?

Do you have a proxy server between you and the internet? If you are
unsure, perhaps examine the proxy settings in the browser you use, or
ask your friendly network administrator or security department - I am
assuming you might be at work.

Could it be your proxy server that wants authentication?

--
Mark

mitsu desai

unread,
May 19, 2015, 1:45:32 AM5/19/15
to jpos-...@googlegroups.com
hi all,

1. Can anyone help me out with an example of QMUX sending asyn requests using request(ISOMsg mlong timeoutISOResponseListener rlObject handBack).
2.  Add explain about what "myMux" is in QMUX mux = (QMUX) NameRegistrar.get ("mux.myMux");

chhil

unread,
May 19, 2015, 4:01:33 AM5/19/15
to jpos-...@googlegroups.com

​​
Look at the QmuxTestCase to get

​a ​
general idea.

https://github.com/jpos/jPOS/blob/master/jpos/src/test/java/org/jpos/q2/iso/QMUXTestCase.java

The gist is write a class that implements ISOResponseListener lets call it MyResponseListener.

See https://github.com/jpos/jPOS/blob/master/jpos/src/main/java/org/jpos/iso/ISOResponseListener.java for methods that you will implement.

Get the Qmux from the registrar

QMUX qmux = (QMUX) NameRegistrar.getIfExists(muxName);

muxName is the name of the qmux bean that was deployed. If you deployed a qmux with a name “myMux” , to get it from the nameregistrar you would use (QMUX) NameRegistrar.getIfExists(“mux.myMux”);
alternatively you could use
QMUX.getMux(“myMux”);

Setup helper objects.

MyResponseListener respListener= new MyResponseListener();

SomeJavaObject xyz = new SomeJavaObject();

This SomeJavaObject could be anything, that you may need for correlating data or a Context or …

Now send the request using the mux.

qmux.request(createISOMsg(), timeToWaitForResponse, respListener , xyz);

When a response is received , jpos qmux will call your
respListener.responseReceived(response, handBack) method that you implemented. Do what you must with the response.

If a response is not received in the timeout period , your objects expired method will get called.

-chhil

​​


--
--
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
 
Join us in IRC at http://webchat.freenode.net/?channels=jpos
 
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
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/37e5f088-afad-401d-b83c-52089d7025f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mitsu desai

unread,
May 19, 2015, 6:59:10 AM5/19/15
to jpos-...@googlegroups.com
Hello Chhil,

Thanks for your quick response. 

I am new to JPOS .In my company i am asked to write a standalone ISO client Module in core java to interact with Bank server over ISO8583.

I used ISOMUX class and channel to send message and get response and it is working fine too. but i wanted to send request asynchronously.

so tried with ISOMUX class method request(ISOMsg m, long timeout, ISOResponseListener r, java.lang.Object handBack) . But received ISO Exception as "Not Implemented"

As ISOMUX is deprecated one , decided to use QMUX request method. 

But i wanted to know few basic things like 

1. what all prequesties required for a standalone QMUX ISO Client development.Normal JDK and Jpos Jars only enough? 

2. If you can , Please explain step by step wat on all things required like xml configuration , qmux bean (Is it separtate class that i should define.If so , wats its functionality.


Thanks In advance

Mitsu

chhil

unread,
May 19, 2015, 10:27:12 AM5/19/15
to jpos-...@googlegroups.com

On Tue, May 19, 2015 at 4:29 PM, mitsu desai <mitsu...@gmail.com> wrote:
1. what all prerequisites required for a standalone QMUX ISO Client development.Normal JDK and Jpos Jars only enough? 

2. If you can , Please explain step by step wat on all things required like xml configuration , qmux bean (Is it separtate class that i should define.If so , wats its functionality.

​I suggest going through http://jpos.org/doc/proguide-draft.pdf.

-chhil


Reply all
Reply to author
Forward
0 new messages