Fixing a Usage leak in broker when subscribing to a topic using selector: AMQ-1889

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@686217 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2008-08-15 14:06:21 +00:00
parent 5a81bbb375
commit 293a6983eb
1 changed files with 3 additions and 1 deletions

View File

@ -570,13 +570,15 @@ public class Topic extends BaseDestination implements Task{
return;
}
}
MessageEvaluationContext msgContext = context.getMessageEvaluationContext();
msgContext.setDestination(destination);
msgContext.setMessageReference(message);
if (!dispatchPolicy.dispatch(message, msgContext, consumers)) {
onMessageWithNoConsumers(context, message);
}
msgContext.clear();
} finally {
dispatchValve.decrement();
}