create default ProducerState for dummy ProducerBrokerExchange to prevent npe when sending to dead letter queues

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@530131 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-04-18 19:04:02 +00:00
parent a1904ea1e7
commit 3baaab2185
1 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,8 @@ import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.broker.ProducerBrokerExchange;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.Message;
import org.apache.activemq.command.ProducerInfo;
import org.apache.activemq.state.ProducerState;
public class BrokerSupport {
@ -39,7 +41,10 @@ public class BrokerSupport {
boolean originalFlowControl=context.isProducerFlowControl();
try{
context.setProducerFlowControl(false);
ProducerInfo info = new ProducerInfo();
ProducerState state = new ProducerState(info);
ProducerBrokerExchange producerExchange = new ProducerBrokerExchange();
producerExchange.setProducerState(state);
producerExchange.setMutable(true);
producerExchange.setConnectionContext(context);
context.getBroker().send(producerExchange,message);