guard against MessageEvaluationContext dropping the message whilst doing the check

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@493032 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-01-05 13:39:42 +00:00
parent aebb18cc57
commit f89d4dcaeb
1 changed files with 4 additions and 2 deletions

View File

@ -56,11 +56,13 @@ public class NetworkBridgeFilter implements DataStructure, BooleanExpression {
}
public boolean matches(MessageEvaluationContext message) throws JMSException{
public boolean matches(MessageEvaluationContext mec) throws JMSException{
try{
//for Queues - the message can be acknowledged and dropped whilst still
//in the dispatch loop
return message.getMessage() != null && matchesForwardingFilter(message.getMessage());
//so need to get the reference to it
Message message = mec.getMessage();
return message != null && matchesForwardingFilter(message);
}catch(IOException e){
throw JMSExceptionSupport.create(e);
}