Base24 connection problem

93 views
Skip to first unread message

Shin

unread,
May 7, 2008, 12:16:21 PM5/7/08
to jPOS Users
Hi all,

Base24 connect to my channel. So it can send the echo message to my
application.
This is a single connection from Base24 to my application.
As i know, normally we will use QMUX connect to client host, then send
the message via QMUX.
How can i send the message to Base24 in this case?


Thank you

--Shin

Miguel Angel Iglesias

unread,
May 7, 2008, 12:23:59 PM5/7/08
to jpos-...@googlegroups.com
Use it all normally, but with Base24Channel and Base24Packager, i am connected to a Base24 system and it works just fine :)

2008/5/7 Shin <nick...@gmail.com>:



--
Miguel Angel Iglesias
o--)---|--(o)--|---(--o
http://caente.com/blog

Shin

unread,
May 7, 2008, 12:40:44 PM5/7/08
to jPOS Users
Hi Miguel,

From my application log, i see Base24 success connect to my
application.
but my QMUX is always try to reconnect. My client told me that this is
the single
connection. Is it means that i need to get the ISOSource and use it
send message?

--Shin

On May 8, 12:23 am, "Miguel Angel Iglesias" <cae...@gmail.com> wrote:
> Use it all normally, but with Base24Channel and Base24Packager, i am
> connected to a Base24 system and it works just fine :)
>
> 2008/5/7 Shin <nickli...@gmail.com>:

Miguel Angel Iglesias

unread,
May 7, 2008, 1:22:04 PM5/7/08
to jpos-...@googlegroups.com
If I understand, what you say is that you have only one port for receive and send messages isnt?
If is that so, look my QMUX configuration, because I had the same problem:

<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="somebank">
 <in>somebank-receive</in>
 <out>somebank-send</out>
 <unhandled>somebank_mux.unhandled</unhandled>
  <space>tspace:somebank</space>
  <request-listener class="com.mycompany.jpos.server.tm.ListenerTM" logger="Q2"/>
  <key> 11, 49 </key>
</mux>

I set the listener on the QMUX, here is my channel adaptor:

<channel-adaptor name='banco-channel-somebank'
    class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2">
 <channel name='channel-somebank' class="com.pagacell.jpos.utiles.SomeBankChannel" logger="Q2"
       packager="com.mycompany.jpos.utiles.SomeBankPackager"
       header="ISO023400050">
  <property name="host" value="localhost" />
  <property name="port" value="9000" />

 </channel>
 <in>somebank-send</in>
 <out>somebank-receive</out>
 <reconnect-delay>60000</reconnect-delay>
 <space>tspace:somebank</space>
</channel-adaptor>

The ProsaPackager extends Base24Packager, I did it because the header.

I hope this works for you.


2008/5/7 Shin <nick...@gmail.com>:

Mark Salter

unread,
May 7, 2008, 2:15:43 PM5/7/08
to jpos-...@googlegroups.com
Shin wrote:

> Base24 connect to my channel. So it can send the echo message to my
> application.

If the BASE24 system connects to you, you should supply an ISOServer for
them to connect to.

> This is a single connection from Base24 to my application.

So they connect once and send echo message you respond to, do you send
them requests or do they send them to you?


> As i know, normally we will use QMUX connect to client host, then send
> the message via QMUX.

The QMUX has an associated Channel, which connects to a port listening
on the remote system.

> How can i send the message to Base24 in this case?

In the process method of your ISORequestListener you will
ISOServer.addISORequestListener(ISORequestListener), you can reply to
echo messages arriving from BASE24.

The ISOServer has a getLastConnectedISOChannel() which returns an
ISOChannel you can then ISOChannel.send(ISOMSg) to pass requests to BASE24.

You just need to lodge the fact a request is outstanding so that in your
ISORequestListener.process method you can tie the response to your
request to complete your flow. A space comes in very handy in this
process, you need a key from the request and response so that the
process method can place the response in the space where the sending
thread is waiting (or timing out).

HTH

--
Mark

Shin

unread,
May 7, 2008, 10:42:13 PM5/7/08
to jPOS Users
> If the BASE24 system connects to you, you should supply an ISOServer for
> them to connect to.
Yes, i have a QServer.

> You just need to lodge the fact a request is outstanding so that in your
> ISORequestListener.process method you can tie the response to your
> request to complete your flow. A space comes in very handy in this
> process, you need a key from the request and response so that the
> process method can place the response in the space where the sending
> thread is waiting (or timing out).
Normally, i use QMUX and it can process request and response with a
key.
I still confuse use space to handle the process.
Can you please talk more details on this part?

Mark Salter

unread,
May 8, 2008, 4:13:33 AM5/8/08
to jpos-...@googlegroups.com
Shin wrote:
>> If the BASE24 system connects to you, you should supply an ISOServer for
>> them to connect to.
> Yes, i have a QServer.
Ok, I hoped you did, but that was not clear from what you had told us so
far.

>
>> You just need to lodge the fact a request is outstanding so that in your
>> ISORequestListener.process method you can tie the response to your
>> request to complete your flow. A space comes in very handy in this
>> process, you need a key from the request and response so that the
>> process method can place the response in the space where the sending
>> thread is waiting (or timing out).
> Normally, i use QMUX and it can process request and response with a
> key.
QMUX handles the matching of response to outstanding request by building
a key from components of the request and the response; as you can
imagine the key needs to be built from fields that are constant between
both.

> I still confuse use space to handle the process.
> Can you please talk more details on this part?

For sending a message:-

Build a key from fields in your request that is unique in 'time',
Get the ISOChannel from ISOServer.getLastConnectedISOChannel(),
Give your request to ISOChannel.send(request),
Do a ISOMsg response = space.in(key,timeoutValue)
if response is null, handle timeout,
else
deal with your response

The compliment of sending is to have code in the process method that:-

recognises it has a response,
builds a key from the response,
space.out(key,tidyDelay);

The space.out will satisfy the waiting space.in in your send flow and
the exchange is complete.


--
Mark

Shin

unread,
May 8, 2008, 7:09:12 AM5/8/08
to jPOS Users
Hi Mark,

I'm using Q2 to start a QServer. Base24 system connect to my QServer.
This is a single connection.
I also start the other QServer for terminal connect to my application.
My application is a aquirer switch. It will route
0200, 0430 message from terminal to Base24.


I implements a ISORequestListener for the Terminal QServer.

public boolean process(ISOSource source, ISOMsg msg){
MUX mux = (MUX) NameRegistrar.get("my-mux");
ISOMsg msgRespFromB24 = mux.request(msg, 30000);
source.send(msgRespFromB24);
}

My problem is QMUX need to use with ChannelAdaptor for send &
receive.
ChannelAdaptor suppose need to create a channel to connect to Base24.
In my case, Base24 only connect to my QServer. It doesn't open any
port for my application to connect.

Thanks.

--Nick

Alejandro Revilla

unread,
May 8, 2008, 8:17:42 AM5/8/08
to jpos-...@googlegroups.com
>
> I'm using Q2 to start a QServer. Base24 system connect to my QServer.
>
The easiest solution is to ask the remote system to operate as a server
then you can easily use QMUX->ChannelAdaptor.

If that can't be done, you can use Mark's suggestion or you can create a
little jPOS service (a QBean, could be just a script or SpaceLet's <run>
script) that would pull messages off QMUX's 'out' queue and send them
over the QServer's lastConnectedISOChannel.

Then you need to attach an ISORequestListener to your QServer that would
push all messages to your QMUX's 'in' queue.

And that's it.

Shin

unread,
May 8, 2008, 8:43:58 AM5/8/08
to jPOS Users
Thanks Alejandro and Mark.

--Shin
Reply all
Reply to author
Forward
0 new messages