mirror of https://github.com/apache/activemq.git
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:
parent
a1904ea1e7
commit
3baaab2185
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue