private void doForward(ProducerBrokerExchange context, Message message, Broker regionBroker, ActiveMQDestination destination) throws Exception { Message forwardedMessage = message.copy(); forwardedMessage.setMemoryUsage(null); forwardedMessage.setOriginalDestination( message.getDestination() ); forwardedMessage.setDestination(destination); // Send it back through the region broker for routing. context.setMutable(true); regionBroker.send(context, forwardedMessage); } }
/** * Re-inject into the Broker chain */ void injectMessage(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { ProducerBrokerExchange pe = producerExchange; if (pe == null) { pe = new ProducerBrokerExchange(); ConnectionContext cc = new ConnectionContext(); cc.setBroker(this.getRoot()); pe.setConnectionContext(cc); pe.setMutable(true); pe.setProducerState(new ProducerState(new ProducerInfo())); } super.send(pe, messageSend); }
context.setProducerFlowControl(false); final ProducerBrokerExchange producerExchange = new ProducerBrokerExchange(); producerExchange.setMutable(true); producerExchange.setConnectionContext(context); producerExchange.setProducerState(new ProducerState(new ProducerInfo()));
private ProducerBrokerExchange getProducerBrokerExchange(ProducerId id) throws IOException { ProducerBrokerExchange result = producerExchanges.get(id); if (result == null) { synchronized (producerExchanges) { result = new ProducerBrokerExchange(); TransportConnectionState state = lookupConnectionState(id); context = state.getContext(); result.setConnectionContext(context); if (context.isReconnect() || (context.isNetworkConnection() && connector.isAuditNetworkProducers())) { result.setLastStoredSequenceId(brokerService.getPersistenceAdapter().getLastProducerSequenceId(id)); } SessionState ss = state.getSessionState(id.getParentId()); if (ss != null) { result.setProducerState(ss.getProducerState(id)); ProducerState producerState = ss.getProducerState(id); if (producerState != null && producerState.getInfo() != null) { ProducerInfo info = producerState.getInfo(); result.setMutable(info.getDestination() == null || info.getDestination().isComposite()); } } producerExchanges.put(id, result); } } else { context = result.getConnectionContext(); } return result; }
private void scheduleRedelivery(ConnectionContext context, MessageReference messageReference, long delay, int redeliveryCount) throws Exception { if (LOG.isTraceEnabled()) { Destination regionDestination = (Destination) messageReference.getRegionDestination(); LOG.trace("redelivery #{} of: {} with delay: {}, dest: {}", new Object[]{ redeliveryCount, messageReference.getMessageId(), delay, regionDestination.getActiveMQDestination() }); } final Message old = messageReference.getMessage(); Message message = old.copy(); message.setTransactionId(null); message.setMemoryUsage(null); message.removeProperty(ScheduledMessage.AMQ_SCHEDULED_ID); message.setProperty(REDELIVERY_DELAY, delay); message.setProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY, delay); message.setRedeliveryCounter(redeliveryCount); 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); } finally { context.setProducerFlowControl(originalFlowControl); } }
producerExchange.setMutable(true); producerExchange.setProducerState(new ProducerState(new ProducerInfo())); super.send(producerExchange, messageSend);
protected void sendStats(ConnectionContext context, ActiveMQMapMessage msg, ActiveMQDestination replyTo) throws Exception { msg.setPersistent(false); msg.setTimestamp(System.currentTimeMillis()); msg.setPriority((byte) javax.jms.Message.DEFAULT_PRIORITY); msg.setType(AdvisorySupport.ADIVSORY_MESSAGE_TYPE); msg.setMessageId(new MessageId(this.advisoryProducerId, this.messageIdGenerator.getNextSequenceId())); msg.setDestination(replyTo); msg.setResponseRequired(false); msg.setProducerId(this.advisoryProducerId); boolean originalFlowControl = context.isProducerFlowControl(); final ProducerBrokerExchange producerExchange = new ProducerBrokerExchange(); producerExchange.setConnectionContext(context); producerExchange.setMutable(true); producerExchange.setProducerState(new ProducerState(new ProducerInfo())); try { context.setProducerFlowControl(false); this.next.send(producerExchange, msg); } finally { context.setProducerFlowControl(originalFlowControl); } }
final ProducerBrokerExchange producerExchange = new ProducerBrokerExchange(); producerExchange.setConnectionContext(context); producerExchange.setMutable(true); producerExchange.setProducerState(new ProducerState(new ProducerInfo())); try {
public static void doResend(final ConnectionContext context, Message originalMessage, ActiveMQDestination deadLetterDestination, boolean copy) throws Exception { Message message = copy ? originalMessage.copy() : originalMessage; message.setOriginalDestination(message.getDestination()); message.setOriginalTransactionId(message.getTransactionId()); message.setDestination(deadLetterDestination); message.setTransactionId(null); message.setMemoryUsage(null); message.setRedeliveryCounter(0); message.getMessageId().setDataLocator(null); 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); } finally { context.setProducerFlowControl(originalFlowControl); } }
final ProducerBrokerExchange producerExchange = new ProducerBrokerExchange(); producerExchange.setConnectionContext(context); producerExchange.setMutable(true); producerExchange.setProducerState(new ProducerState(new ProducerInfo())); try {
context.setProducerFlowControl(false); ProducerBrokerExchange producerExchange = new ProducerBrokerExchange(); producerExchange.setMutable(false); producerExchange.setConnectionContext(context); producerExchange.setProducerState(new ProducerState(new ProducerInfo()));
private void doForward(ProducerBrokerExchange context, Message message, Broker regionBroker, ActiveMQDestination destination) throws Exception { Message forwardedMessage = message.copy(); forwardedMessage.setMemoryUsage(null); forwardedMessage.setOriginalDestination( message.getDestination() ); forwardedMessage.setDestination(destination); // Send it back through the region broker for routing. context.setMutable(true); regionBroker.send(context, forwardedMessage); } }
private void doForward(ProducerBrokerExchange context, Message message, Broker regionBroker, ActiveMQDestination destination) throws Exception { Message forwardedMessage = message.copy(); forwardedMessage.setMemoryUsage(null); forwardedMessage.setOriginalDestination( message.getDestination() ); forwardedMessage.setDestination(destination); // Send it back through the region broker for routing. context.setMutable(true); regionBroker.send(context, forwardedMessage); } }
private void doForward(ProducerBrokerExchange context, Message message, Broker regionBroker, ActiveMQDestination destination) throws Exception { Message forwardedMessage = message.copy(); forwardedMessage.setMemoryUsage(null); forwardedMessage.setOriginalDestination( message.getDestination() ); forwardedMessage.setDestination(destination); // Send it back through the region broker for routing. context.setMutable(true); regionBroker.send(context, forwardedMessage); } }
/** * Re-inject into the Broker chain */ void injectMessage(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { ProducerBrokerExchange pe = producerExchange; if (pe == null) { pe = new ProducerBrokerExchange(); ConnectionContext cc = new ConnectionContext(); cc.setBroker(this.getRoot()); pe.setConnectionContext(cc); pe.setMutable(true); pe.setProducerState(new ProducerState(new ProducerInfo())); } super.send(pe, messageSend); }
/** * Re-inject into the Broker chain */ void injectMessage(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { ProducerBrokerExchange pe = producerExchange; if (pe == null) { pe = new ProducerBrokerExchange(); ConnectionContext cc = new ConnectionContext(); cc.setBroker(this.getRoot()); pe.setConnectionContext(cc); pe.setMutable(true); pe.setProducerState(new ProducerState(new ProducerInfo())); } super.send(pe, messageSend); }
/** * Re-inject into the Broker chain */ void injectMessage(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { ProducerBrokerExchange pe = producerExchange; if (pe == null) { pe = new ProducerBrokerExchange(); ConnectionContext cc = new ConnectionContext(); cc.setBroker(this.getRoot()); pe.setConnectionContext(cc); pe.setMutable(true); pe.setProducerState(new ProducerState(new ProducerInfo())); } super.send(pe, messageSend); }
protected void sendStats(ConnectionContext context, ActiveMQMapMessage msg, ActiveMQDestination replyTo) throws Exception { msg.setPersistent(false); msg.setTimestamp(System.currentTimeMillis()); msg.setPriority((byte) javax.jms.Message.DEFAULT_PRIORITY); msg.setType(AdvisorySupport.ADIVSORY_MESSAGE_TYPE); msg.setMessageId(new MessageId(this.advisoryProducerId, this.messageIdGenerator.getNextSequenceId())); msg.setDestination(replyTo); msg.setResponseRequired(false); msg.setProducerId(this.advisoryProducerId); boolean originalFlowControl = context.isProducerFlowControl(); final ProducerBrokerExchange producerExchange = new ProducerBrokerExchange(); producerExchange.setConnectionContext(context); producerExchange.setMutable(true); producerExchange.setProducerState(new ProducerState(new ProducerInfo())); try { context.setProducerFlowControl(false); this.next.send(producerExchange, msg); } finally { context.setProducerFlowControl(originalFlowControl); } }
protected void sendStats(ConnectionContext context, ActiveMQMapMessage msg, ActiveMQDestination replyTo) throws Exception { msg.setPersistent(false); msg.setTimestamp(System.currentTimeMillis()); msg.setPriority((byte) javax.jms.Message.DEFAULT_PRIORITY); msg.setType(AdvisorySupport.ADIVSORY_MESSAGE_TYPE); msg.setMessageId(new MessageId(this.advisoryProducerId, this.messageIdGenerator.getNextSequenceId())); msg.setDestination(replyTo); msg.setResponseRequired(false); msg.setProducerId(this.advisoryProducerId); boolean originalFlowControl = context.isProducerFlowControl(); final ProducerBrokerExchange producerExchange = new ProducerBrokerExchange(); producerExchange.setConnectionContext(context); producerExchange.setMutable(true); producerExchange.setProducerState(new ProducerState(new ProducerInfo())); try { context.setProducerFlowControl(false); this.next.send(producerExchange, msg); } finally { context.setProducerFlowControl(originalFlowControl); } }
public static void doResend(final ConnectionContext context, Message originalMessage, ActiveMQDestination deadLetterDestination, boolean copy) throws Exception { Message message = copy ? originalMessage.copy() : originalMessage; message.setOriginalDestination(message.getDestination()); message.setOriginalTransactionId(message.getTransactionId()); message.setDestination(deadLetterDestination); message.setTransactionId(null); message.setMemoryUsage(null); message.setRedeliveryCounter(0); message.getMessageId().setDataLocator(null); 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); } finally { context.setProducerFlowControl(originalFlowControl); } }