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, ...@@ -298,13 +298,19 @@ public class JMSBridgeModule implements javax.jms.ExceptionListener,
logger.log(BasicLevel.WARN, "Exception:: XA can't start resource : " + consumerRes, e); logger.log(BasicLevel.WARN, "Exception:: XA can't start resource : " + consumerRes, e);
} }
} }
javax.jms.Message msg = consumer.receiveNoWait();
if (msg != null) {
org.objectweb.joram.client.jms.Message clientMessage = org.objectweb.joram.client.jms.Message clientMessage =
org.objectweb.joram.client.jms.Message.convertJMSMessage(consumer.receiveNoWait()); org.objectweb.joram.client.jms.Message.convertJMSMessage(msg);
if (logger.isLoggable(BasicLevel.DEBUG)) if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "receiveNoWait: clientMessage=" + clientMessage); 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) { if (isXA) {
try { try {
consumerRes.end(xid, XAResource.TMSUCCESS); consumerRes.end(xid, XAResource.TMSUCCESS);
......
...@@ -209,6 +209,7 @@ public class JMSBridgeQueueImpl extends QueueImpl { ...@@ -209,6 +209,7 @@ public class JMSBridgeQueueImpl extends QueueImpl {
message = null; message = null;
QueueMsgReply reply = new QueueMsgReply(not); QueueMsgReply reply = new QueueMsgReply(not);
if (message != null)
reply.addMessage(message); reply.addMessage(message);
forward(from, reply); forward(from, reply);
......
Supports Markdown
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