horacioaeg | 5 Mar 18:53

Doubt on receiving a response

Hello, I'll try to be as clear as I can. My application only needs to
send 0200 and receive 0210, and also if something goes wrong, send a
reverse 0420 and receive 0430. 

My custom packager is already set up according to me ISO
specifications, my doubt is when I send this ISOMsg what's the best
way of listening for a response, I'll need to have a not so big
timeout, since the user is on the other side waiting on the telephone
for a response. 

Is it better to use channel.receive()? I don't think mux is the answer
since I won't get multiple connections even though many users will use
the application simultaneously, do I need to thread this receive() to
get it to timeout?

Thanks a lot

 
Alejandro Revilla | 5 Mar 19:20

Re: Doubt on receiving a response

> 
> Is it better to use channel.receive()? I don't think mux is the answer
> since I won't get multiple connections even though many users will use
> the application simultaneously, do I need to thread this receive() to
> get it to timeout?
> 
I'd use a MUX (actually ChannelAdaptor and QMUX).

 
Mark Salter | 5 Mar 22:11

Re: Doubt on receiving a response

horacioaeg wrote:

> Is it better to use channel.receive()? I don't think mux is the answer
> since I won't get multiple connections even though many users will use
> the application simultaneously, do I need to thread this receive() to
> get it to timeout?
If you use channel.receive() then you have to do you own matching of 
responses to requests.  Possibly the way to go if you only ever have a 
single message in flight at any time.

You sound like you will have multiple requests going off to your host 
and the responses may come back in a different order to the one the 
requests went in.

This is what a mux looks after...

... not multiple connection to the target host, but asynchronous message 
handling.

Add a mux to your arsenal and use :-

    ISOMsg response = mux.request(myRequest, timeout)

If things timeout, response will be null and you can react accordingly 
informing your user, otherwise (with the correct matching criteria 
established it holds the response.  If you need to reverse the late 
arriving responses, give the mux an ISORequestListener and you will get 
a chance to process the unmatched responses (likely timeouts arriving 
late) and you can generate your reversal messages.

(Continue reading)

horacioaeg | 28 Mar 20:39

Re: Doubt on receiving a response

Thanks Mark and Alejandro, this is mainly the code I'm using

ISOCUSTOMPackager mypack = new ISOCUSTOMPackager();
Logger logger = new Logger();
logger.addListener(new SimpleLogListener(System.out));
ISOChannel channel = new XMLChannel ("server", 10000, new XMLPackager());

((LogSource)channel).setLogger(logger, "test-channel");
channel.connect();

         
Thread serviceThread=null;
ISOMUX mux = new ISOMUX(channel);
ISOMsg response = new ISOMsg();
ISORequest request = null;
ISOMsg m = new ISOMsg();

mux.getConnect();
serviceThread=new Thread(mux);
serviceThread.start();

m.setMTI("0200");
m.set ( 2, "1111111111111111111");
m.set ( 3, "000000");
....
				
request=new ISORequest(m);
for (int i=0; i < retry; i++){
    mux.queue(request);
    response=request.getResponse(3000);
(Continue reading)

Alejandro Revilla | 29 Mar 00:15

Re: Re: Doubt on receiving a response

Creating and terminating an ISOMUX per request sounds like overkill to me.

>
> I don't want to use Q2 is because the platform where the program will
> be running, is not a standard platform so I'll rather have everything
> inside the program rather than xml files.
> 
What kind of platform are you talking about? Is there anything we can do
to enable Q2 in that platform?

------------------------------------

Re: Re: Doubt on receiving a response

Sorry, it seams that I lost the thread of the discussion and now I don't
know what is the problem, but maybe I can help. I also use ISOMUX in a web
server(the ISOMUX connects whit a Q2 platform) in a similar way that you do
with excellent performance (at least in a testing environment I have send
4000 simultaneous transactions and everything okay ), so can you please tell
me what is your error? perhaps I had a similar experience

2008/3/28, Alejandro Revilla <apr@...>:
>
> Creating and terminating an ISOMUX per request sounds like overkill to me.
>
>
> >
> > I don't want to use Q2 is because the platform where the program will
> > be running, is not a standard platform so I'll rather have everything
> > inside the program rather than xml files.
> >
>
> What kind of platform are you talking about? Is there anything we can do
> to enable Q2 in that platform?
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
(Continue reading)

horacioaeg | 31 Mar 20:25

Re: Doubt on receiving a response

Alejandro, I'm not sure I understand what you mean, why do you say
it's an overkill?

Miguel, there's actually no problem with the program i just wanted
some feedback about my implementation if it's the right way of
handling messages, I expect about 300 transactions per day max.

Thanks

--- In jpos-dev@..., "Miguel Angel Iglesias" <caente@...>
wrote:
>
> Sorry, it seams that I lost the thread of the discussion and now I don't
> know what is the problem, but maybe I can help. I also use ISOMUX in
a web
> server(the ISOMUX connects whit a Q2 platform) in a similar way that
you do
> with excellent performance (at least in a testing environment I have
send
> 4000 simultaneous transactions and everything okay ), so can you
please tell
> me what is your error? perhaps I had a similar experience
> 
> 
> 2008/3/28, Alejandro Revilla <apr@...>:
> >
> > Creating and terminating an ISOMUX per request sounds like
overkill to me.
> >
> >
(Continue reading)

Re: Re: Doubt on receiving a response

well, I am just making some load test right now, and my ISOMUX in glassfish
handle 1000 concurrent transactions very nice... but if there is a better
way I would be happy to know it ;)

2008/3/31, horacioaeg <horacioaeg@...>:
>
> Alejandro, I'm not sure I understand what you mean, why do you say
> it's an overkill?
>
> Miguel, there's actually no problem with the program i just wanted
> some feedback about my implementation if it's the right way of
> handling messages, I expect about 300 transactions per day max.
>
> Thanks
>
>
> --- In jpos-dev@..., "Miguel Angel Iglesias" <caente@...>
> wrote:
>
> >
> > Sorry, it seams that I lost the thread of the discussion and now I don't
> > know what is the problem, but maybe I can help. I also use ISOMUX in
> a web
> > server(the ISOMUX connects whit a Q2 platform) in a similar way that
> you do
> > with excellent performance (at least in a testing environment I have
> send
> > 4000 simultaneous transactions and everything okay ), so can you
> please tell
> > me what is your error? perhaps I had a similar experience
(Continue reading)

Alejandro Revilla | 31 Mar 21:23

Re: Re: Doubt on receiving a response

>
> Alejandro, I'm not sure I understand what you mean, why do you say
> it's an overkill?
> 
I think that creating a MUX, starting it in its own thread, and then
terminating it for every message is overkill.

In our systems we use long lived components (servers, channels and
muxes).

If it works for you, then that's fine, though.

------------------------------------

Re: Re: Doubt on receiving a response

wow, as I understand, is only one thread isn't it?
thats what I do, create a thread and queue all the message to send...  I
guess thats what horacio do...

2008/3/31, Alejandro Revilla <apr@...>:
>
> >
> > Alejandro, I'm not sure I understand what you mean, why do you say
> > it's an overkill?
> >
>
> I think that creating a MUX, starting it in its own thread, and then
> terminating it for every message is overkill.
>
> In our systems we use long lived components (servers, channels and
> muxes).
>
> If it works for you, then that's fine, though.
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>

(Continue reading)

Alejandro Revilla | 31 Mar 21:57

Re: Re: Doubt on receiving a response

>
> wow, as I understand, is only one thread isn't it?
> thats what I do, create a thread and queue all the message to send...  I
> guess thats what horacio do...
> 
Oops, Sorry. Great then. I though you were creating one thread per request.

------------------------------------

horacioaeg | 3 Apr 23:51

Re: Doubt on receiving a response

Hello guys, I did some tests with my application and I'm not getting a
response even though the other party is sending me one, (I checked the
logs, it generates 0210) Could this be a channel issue?, I've already
attached a logger to system.out, but don't see anything except that it
kills my connection. any ideas to debug?
thanks

--- In jpos-dev@..., Alejandro Revilla <apr@...> wrote:
>
> >
> > wow, as I understand, is only one thread isn't it?
> > thats what I do, create a thread and queue all the message to
send...  I
> > guess thats what horacio do...
> > 
> Oops, Sorry. Great then. I though you were creating one thread per
request.
>

------------------------------------

johnnyoverland | 4 Apr 04:49

Re: Doubt on receiving a response

I am probably late to this party but I think I had this issue when I 
was using the ISOMux.  Your code looks very similar to my testbed code 
and the problem that I had was related to the data coming back. Either 
the host was not returning  the STAN (field 11) or modifying it, I 
can't remember.

In any case, this might not be your issue but I thought it might help.

The ISOMux code uses:

    /**
     * construct key to match request with responses
     * @param   m   request/response
     * @return      key (default terminal(41) + tracenumber(11))
     */

-John

------------------------------------

Mark Salter | 4 Apr 07:37

Re: Re: Doubt on receiving a response

horacioaeg wrote:
> Hello guys, I did some tests with my application and I'm not getting a
> response even though the other party is sending me one, (I checked the
> logs, it generates 0210) Could this be a channel issue?, I've already
> attached a logger to system.out, but don't see anything except that it
> kills my connection. any ideas to debug?
> thanks

So the 0210 is arriving but not being matched to the request?

Does your processing include a MUX at all?

If so, check that the key fields it is matching on actually match in the 
request and the response.

Say it is using fields 11 and 41, if these fields do not match in the 
request and the response, then response will not match the request and 
thus won't be returned to you just end up in the unhandled bucket.

--

-- 
Mark

------------------------------------

Re: Re: Doubt on receiving a response

Hi Alejandro! Can I be removed from the mailing list? Thanks. I do love
jpos but
have completed my project.

Thanks,

Alex

Original Message:
-----------------
From: Alejandro Revilla apr@...
Date: Fri, 28 Mar 2008 20:15:09 -0300
To: jpos-dev@...
Subject: Re: [jpos-dev] Re: Doubt on receiving a response

Creating and terminating an ISOMUX per request sounds like overkill to me.

>
> I don't want to use Q2 is because the platform where the program will
> be running, is not a standard platform so I'll rather have everything
> inside the program rather than xml files.
> 
What kind of platform are you talking about? Is there anything we can do
to enable Q2 in that platform?

--------------------------------------------------------------------
mail2web LIVE – Free email based on Microsoft® Exchange technology -
http://link.mail2web.com/LIVE

------------------------------------
(Continue reading)

David Bergert | 1 Apr 03:05

RE: Re: Doubt on receiving a response

See the link below:

Unsubscribe  <mailto:jpos-dev-unsubscribe@...?subject=>  -
jpos-dev-unsubscribe@...

Messages
<http://groups.yahoo.com/group/jpos-dev/message/7878;_ylc=X3oDMTMzdm12MDQ3BF
9TAzk3MzU5NzE0BGdycElkAzI5MzU3NwRncnBzcElkAzE3MDUwMDY3NjQEbXNnSWQDNzg5MQRzZW
MDZnRyBHNsawN2dHBjBHN0aW1lAzEyMDcwMTA1NTgEdHBjSWQDNzg3OA-->  in this topic
(12)
<http://groups.yahoo.com/group/jpos-dev/post;_ylc=X3oDMTJvZ2VmbDBqBF9TAzk3Mz
U5NzE0BGdycElkAzI5MzU3NwRncnBzcElkAzE3MDUwMDY3NjQEbXNnSWQDNzg5MQRzZWMDZnRyBH
NsawNycGx5BHN0aW1lAzEyMDcwMTA1NTg-?act=reply&messageNum=7891> Reply (via web
post) | Start
<http://groups.yahoo.com/group/jpos-dev/post;_ylc=X3oDMTJkMG5sc2hvBF9TAzk3Mz
U5NzE0BGdycElkAzI5MzU3NwRncnBzcElkAzE3MDUwMDY3NjQEc2VjA2Z0cgRzbGsDbnRwYwRzdG
ltZQMxMjA3MDEwNTU4>  a new topic 

Messages
<http://groups.yahoo.com/group/jpos-dev/messages;_ylc=X3oDMTJkZmJzb3RpBF9TAz
k3MzU5NzE0BGdycElkAzI5MzU3NwRncnBzcElkAzE3MDUwMDY3NjQEc2VjA2Z0cgRzbGsDbXNncw
RzdGltZQMxMjA3MDEwNTU4>  | Files
<http://groups.yahoo.com/group/jpos-dev/files;_ylc=X3oDMTJlaGNsc2JqBF9TAzk3M
zU5NzE0BGdycElkAzI5MzU3NwRncnBzcElkAzE3MDUwMDY3NjQEc2VjA2Z0cgRzbGsDZmlsZXMEc
3RpbWUDMTIwNzAxMDU1OA-->  | Photos
<http://groups.yahoo.com/group/jpos-dev/photos;_ylc=X3oDMTJkOGthNGZnBF9TAzk3
MzU5NzE0BGdycElkAzI5MzU3NwRncnBzcElkAzE3MDUwMDY3NjQEc2VjA2Z0cgRzbGsDcGhvdARz
dGltZQMxMjA3MDEwNTU4>  | Links
<http://groups.yahoo.com/group/jpos-dev/links;_ylc=X3oDMTJlYzQ1dmpzBF9TAzk3M
zU5NzE0BGdycElkAzI5MzU3NwRncnBzcElkAzE3MDUwMDY3NjQEc2VjA2Z0cgRzbGsDbGlua3MEc
(Continue reading)


Gmane