Commit a67c8a2a authored by afreyssin's avatar afreyssin
Browse files

Bug fix: no longer have a NPE when a bridge client use receiveNoWait JMS method.

parent 21e2f135
......@@ -298,13 +298,19 @@ public class JMSBridgeModule implements javax.jms.ExceptionListener,
logger.log(BasicLevel.WARN, "Exception:: XA can't start resource : " + consumerRes, e);
}
}
org.objectweb.joram.client.jms.Message clientMessage =
org.objectweb.joram.client.jms.Message.convertJMSMessage(consumer.receiveNoWait());
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "receiveNoWait: clientMessage=" + clientMessage);
javax.jms.Message msg = consumer.receiveNoWait();
if (msg != null) {
org.objectweb.joram.client.jms.Message clientMessage =
org.objectweb.joram.client.jms.Message.convertJMSMessage(msg);
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "receiveNoWait: clientMessage=" + clientMessage);
momMessage = clientMessage.getMomMsg();
momMessage = clientMessage.getMomMsg();
} else {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "receiveNoWait: no message available");
}
if (isXA) {
try {
consumerRes.end(xid, XAResource.TMSUCCESS);
......
......@@ -209,7 +209,8 @@ public class JMSBridgeQueueImpl extends QueueImpl {
message = null;
QueueMsgReply reply = new QueueMsgReply(not);
reply.addMessage(message);
if (message != null)
reply.addMessage(message);
forward(from, reply);
if (logger.isLoggable(BasicLevel.DEBUG))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment