JTO
unread,Nov 16, 2009, 2:25:22 PM11/16/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jPOS Users
Hi guys,
I am attemping to use a MuxPool and must be missing a connection (in
my head) somewhere but I have been unable to isolate where. I think it
is just my understanding of the MuxPool and hopefully someone has
implemented one and can show me the light.
I have a channel coming in, passing the TXN to a TransactionManager,
which is then passed to a particpant. In the participant routine the
message comes to sendResponse. The message times out and is never
returned. I thought it was because the muxes (and MuxPool) always
return false to isConnected(). After further testing, if I change my
TxnMgr configuration it works, so now I am really lost. ANy ideas on
what I am doing wrong?
( <property name="targetMux" value="BAL_Mux_Primary" /> ) <<< This
works, direct to Mux
( <property name="targetMux" value="MuxPool" /> ) <<< This never
returns from MuxPool
--- name-registrar ---
mux.MuxPool: org.jpos.q2.iso.MUXPool
mux.BAL_Mux_StandIn: org.jpos.q2.iso.QMUX
tx=0, rx=0, tx_expired=0, tx_pending=0, rx_expired=0,
rx_pending=0, rx_unhandled=0, rx_forwarded=0, connected=false, last=0
mux.BAL_Mux_Primary: org.jpos.q2.iso.QMUX
tx=0, rx=0, tx_expired=0, tx_pending=0, rx_expired=0,
rx_pending=0, rx_unhandled=0, rx_forwarded=0, connected=false, last=0
mux.BAL_Mux_Secondary: org.jpos.q2.iso.QMUX
tx=0, rx=0, tx_expired=0, tx_pending=0, rx_expired=0, rx_pending=0,
rx_unhandled=0, rx_forwarded=0, connected=false, last=0
BE-Test-03: org.jpos.q2.iso.ChannelAdaptor
tx=0, rx=0, connects=1, last=0
BE-Test-02: org.jpos.q2.iso.ChannelAdaptor
tx=0, rx=0, connects=1, last=0
logger.Log-CC: org.jpos.util.Logger
BE-Test-01: org.jpos.q2.iso.ChannelAdaptor
tx=0, rx=0, connects=1, last=0
I have included a snippet of the code
private void sendResponse(long id, Context ctx) {
ISOMsg response=null;
ISOSource source = (ISOSource) ctx.get("source");
ISOMsg resp = (ISOMsg) ctx.get( cfg.get("queue"));
ISOMsg req = (ISOMsg) resp.clone();
ISOMsg convertedRequest = (ISOMsg) resp.clone();
if (source == null || !source.isConnected())
{
return; // too late . . .
}
try {
// This was done because no getMux() exists in Mux.java
MUX pooledMux = (MUX) NameRegistrar.get ("mux."+ cfg.get
("targetMux", "noTargetMux"));
// This always returns false, why?
pooledMux.isConnected();
// Always times out because no muxes appear to be available
(isConnected()=false)
response = pooledMux.request(req, cfg.getLong("timeout",25000 ));
if (source != null && source.isConnected() && response != null)
{
source.send(response);
}else{
convertedRequest.setDirection(ISOMsg.OUTGOING);
source.send(errorMsg(source, convertedRequest));
}
} catch (Exception t)
{
Logger.log(new LogEvent((LogSource) this,"Exception in sendReponse",
e));
}
}
}