Tabnine Logo
Broker.send
Code IndexAdd Tabnine to your IDE (free)

How to use
send
method
in
org.apache.activemq.broker.Broker

Best Java code snippets using org.apache.activemq.broker.Broker.send (Showing top 20 results out of 315)

origin: apache/activemq

@Override
public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception {
  next.send(producerExchange, messageSend);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].send(producerExchange, messageSend);
  }
}
origin: apache/activemq

@Override
public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception {
  getNext().send(producerExchange, messageSend);
}
origin: apache/activemq

/** Sets the persistence mode
 * @see org.apache.activemq.broker.BrokerFilter#send(org.apache.activemq.broker.ProducerBrokerExchange, org.apache.activemq.command.Message)
 */
public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception {
 messageSend.getMessage().setPersistent(isPersistent());
 next.send(producerExchange, messageSend);
}

origin: apache/activemq

@Override
public Response processMessage(Message messageSend) throws Exception {
  ProducerId producerId = messageSend.getProducerId();
  ProducerBrokerExchange producerExchange = getProducerBrokerExchange(producerId);
  if (producerExchange.canDispatch(messageSend)) {
    broker.send(producerExchange, messageSend);
  }
  return null;
}
origin: apache/activemq

/**
 * 
 */
public void send(ProducerBrokerExchange producerExchange, Message message) throws Exception {
  ActiveMQDestination destination = message.getDestination();
  if (destination.isComposite()) {
    ActiveMQDestination[] destinations = destination.getCompositeDestinations();
    for (int i = 0; i < destinations.length; i++) {
      if (i != 0) {
        message = message.copy();
        message.setMemoryUsage(null);
      }
      message.setOriginalDestination(destination);
      message.setDestination(destinations[i]);
      next.send(producerExchange, message);
    }
  } else {
    next.send(producerExchange, message);
  }
}
origin: apache/activemq

  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);
  }
}
origin: apache/activemq

public void send(ProducerBrokerExchange producerExchange, final Message message) throws Exception {
  // This method may be invoked recursively.
  // Track original tx so that it can be restored.
  final ConnectionContext context = producerExchange.getConnectionContext();
  Transaction originalTx = context.getTransaction();
  Transaction transaction = null;
  if (message.getTransactionId() != null) {
    transaction = getTransaction(context, message.getTransactionId(), false);
  }
  context.setTransaction(transaction);
  try {
    next.send(producerExchange, message);
  } finally {
    context.setTransaction(originalTx);
  }
}
origin: apache/activemq

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);
  }
}
origin: apache/activemq

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);
  }
}
origin: apache/activemq

try {
  context.setProducerFlowControl(false);
  this.next.send(producerExchange, msg);
} finally {
  context.setProducerFlowControl(originalFlowControl);
origin: apache/activemq

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);
  }
}
origin: apache/activemq

try {
  context.setProducerFlowControl(false);
  next.send(producerExchange, advisoryMessage);
} finally {
  context.setProducerFlowControl(originalFlowControl);
origin: apache/activemq

  producerExchange.setConnectionContext(context);
  producerExchange.setProducerState(new ProducerState(new ProducerInfo()));
  context.getBroker().send(producerExchange, message);
} finally {
  context.setProducerFlowControl(originalFlowControl);
origin: org.apache.activemq/activemq-broker

@Override
public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception {
  next.send(producerExchange, messageSend);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].send(producerExchange, messageSend);
  }
}
origin: org.apache.activemq/activemq-osgi

@Override
public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception {
  next.send(producerExchange, messageSend);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].send(producerExchange, messageSend);
  }
}
origin: org.apache.activemq/activemq-all

/** Sets the persistence mode
 * @see org.apache.activemq.broker.BrokerFilter#send(org.apache.activemq.broker.ProducerBrokerExchange, org.apache.activemq.command.Message)
 */
public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception {
 messageSend.getMessage().setPersistent(isPersistent());
 next.send(producerExchange, messageSend);
}

origin: org.apache.activemq/activemq-broker

/** Sets the persistence mode
 * @see org.apache.activemq.broker.BrokerFilter#send(org.apache.activemq.broker.ProducerBrokerExchange, org.apache.activemq.command.Message)
 */
public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception {
 messageSend.getMessage().setPersistent(isPersistent());
 next.send(producerExchange, messageSend);
}

origin: org.apache.activemq/activemq-broker

@Override
public Response processMessage(Message messageSend) throws Exception {
  ProducerId producerId = messageSend.getProducerId();
  ProducerBrokerExchange producerExchange = getProducerBrokerExchange(producerId);
  if (producerExchange.canDispatch(messageSend)) {
    broker.send(producerExchange, messageSend);
  }
  return null;
}
origin: org.apache.activemq/activemq-broker

  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);
  }
}
origin: org.apache.activemq/activemq-all

  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);
  }
}
org.apache.activemq.brokerBrokersend

Javadoc

A message needs to go the a DLQ

Popular methods of Broker

  • getAdaptor
    Get a Broker from the Broker Stack that is a particular class
  • getDestinationMap
    return a reference destination map of a region based on the destination type
  • removeDestination
  • commitTransaction
    Commits a transaction.
  • forgetTransaction
    Forgets a transaction.
  • getBrokerService
  • getClients
  • getDestinations
  • getPreparedTransactions
    Gets a list of all the prepared xa transactions.
  • getVmConnectorURI
  • removeConsumer
  • acknowledge
  • removeConsumer,
  • acknowledge,
  • addBroker,
  • addConnection,
  • addConsumer,
  • addDestination,
  • addDestinationInfo,
  • addProducer,
  • addSession,
  • beginTransaction

Popular in Java

  • Creating JSON documents from java classes using gson
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • Menu (java.awt)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now