|
From: Daniel B. <Dan...@os...> - 2003-08-01 10:07:11
|
Hi,
I have made a small program that uses Hermes to send a Ping request to
another MSH implementation and waits for a Pong reply. The problem is that I
never get the Pong reply. The log tells me that Hermes actually gets the
Pong reply but the reply is never sent to my client (other messages gets to
the client, so there's nothing wrong with it...).
I have attached a snipp from the log that confirms that Hermes actually gets
the reply. I have also attached my client code (I have just made small
modifications to the loopback example).
Looking into the code I can see that Pong replies get a special treatment. A
Delivery thread is attached to the Transaction object, but since I use the
polling scenario (the first one described in the user documentation) this
thread does nothing. As far as I can see the message isn't saved at all, so
obviously my polling client never finds it. Shouldn't the message be stored
on the messageServer just like any other messages?
MessageServiceHandler.java version 1.173 Line 4914
else if (isPong) {
String pingMessageId = ebxmlMessage.getMessageHeader().
getRefToMessageId();
appContext = messageServer.getApplicationContext
(pingMessageId, tx);
mshConnection = (MessageServiceHandlerConnection)
mshConnectionTable.get(appContext);
Delivery delivery = new Delivery(this, appContext,
mshConnection.getMessageServiceHandlerConfig().
getMessageListener(), ebxmlMessage);
tx.addThread(delivery);
logger.info("Pong message is received");
}
Maybe this code should be changed to something like the following (WARNING I
haven't tested this at all).
else if (isPong) {
String pingMessageId = ebxmlMessage.getMessageHeader().
getRefToMessageId();
appContext = messageServer.getApplicationContext
(pingMessageId, tx);
mshConnection = (MessageServiceHandlerConnection)
mshConnectionTable.get(appContext);
messageServer.store(ebxmlMessage, appContext,
MessageServer.STATE_RECEIVED, false, tx);
Delivery delivery = new Delivery(this, appContext,
mshConnection.getMessageServiceHandlerConfig().
getMessageListener(), ebxmlMessage);
tx.addThread(delivery);
logger.info("Pong message is received");
}
Comments to the code: I have just tried my client on the 0931-release, but
the current Pong handling code in the CVS repository doesn't seem to have
changed...
Regards
Daniel Bergh
|