> 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
> 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
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.