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

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

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

origin: apache/activemq

@Override
public void messageExpired(ConnectionContext context, MessageReference message, Subscription subscription) {
  getNext().messageExpired(context, message, subscription);
}
origin: apache/activemq

@Override
public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference) {
  LOG.debug("message expired: {}", reference);
  broker.messageExpired(context, reference, subs);
  destinationStatistics.getExpired().increment();
  try {
    removeMessage(context, subs, (QueueMessageReference) reference);
    messagesLock.writeLock().lock();
    try {
      messages.rollback(reference.getMessageId());
    } finally {
      messagesLock.writeLock().unlock();
    }
  } catch (IOException e) {
    LOG.error("Failed to remove expired Message from the store ", e);
  }
}
origin: apache/activemq

@Override
public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference) {
  broker.messageExpired(context, reference, subs);
  // AMQ-2586: Better to leave this stat at zero than to give the user
  // misleading metrics.
  // destinationStatistics.getMessages().decrement();
  destinationStatistics.getExpired().increment();
  MessageAck ack = new MessageAck();
  ack.setAckType(MessageAck.STANDARD_ACK_TYPE);
  ack.setDestination(destination);
  ack.setMessageID(reference.getMessageId());
  try {
    if (subs instanceof DurableTopicSubscription) {
      ((DurableTopicSubscription)subs).removePending(reference);
    }
    acknowledge(context, subs, ack, reference);
  } catch (Exception e) {
    LOG.error("Failed to remove expired Message from the store ", e);
  }
}
origin: apache/activemq

@Override
public void afterCommit() throws Exception {
  // It could take while before we receive the commit
  // operation.. by that time the message could have
  // expired..
  if (message.isExpired()) {
    if (broker.isExpired(message)) {
      getDestinationStatistics().getExpired().increment();
      broker.messageExpired(context, message, null);
    }
    message.decrementReferenceCount();
    return;
  }
  try {
    dispatch(context, message);
  } finally {
    message.decrementReferenceCount();
  }
}
origin: apache/activemq

/**
 * Discard any expired messages from the matched list. Called from a
 * synchronized block.
 *
 * @throws IOException
 */
protected void removeExpiredMessages() throws IOException {
  try {
    matched.reset();
    while (matched.hasNext()) {
      MessageReference node = matched.next();
      node.decrementReferenceCount();
      if (node.isExpired()) {
        matched.remove();
        node.decrementReferenceCount();
        if (broker.isExpired(node)) {
          ((Destination) node.getRegionDestination()).getDestinationStatistics().getExpired().increment();
          broker.messageExpired(getContext(), node, this);
        }
        break;
      }
    }
  } finally {
    matched.release();
  }
}
origin: apache/activemq

  broker.messageExpired(context, message, null);
  destinationStatistics.getExpired().increment();
} else {
origin: apache/activemq

broker.messageExpired(context, message, null);
getDestinationStatistics().getExpired().increment();
if (sendProducerAck) {
origin: apache/activemq

  @Override
  public void run() {
    try {
      // While waiting for space to free up... the
      // message may have expired.
      if (message.isExpired()) {
        broker.messageExpired(context, message, null);
        getDestinationStatistics().getExpired().increment();
      } else {
        doMessageSend(producerExchange, message);
      }
      if (sendProducerAck) {
        ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message
            .getSize());
        context.getConnection().dispatchAsync(ack);
      } else {
        Response response = new Response();
        response.setCorrelationId(message.getCommandId());
        context.getConnection().dispatchAsync(response);
      }
    } catch (Exception e) {
      if (!sendProducerAck && !context.isInRecoveryMode()) {
        ExceptionResponse response = new ExceptionResponse(e);
        response.setCorrelationId(message.getCommandId());
        context.getConnection().dispatchAsync(response);
      }
    }
  }
});
origin: apache/activemq

if (message.isExpired()) {
  broker.getRoot().messageExpired(context, message, null);
  if (sendProducerAck) {
    ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message.getSize());
        broker.getRoot().messageExpired(context, message, null);
        return;
origin: pierre/meteo

public void messageExpired(ConnectionContext context, MessageReference message, Subscription subscription) {
  next.messageExpired(context, message, subscription);
}
origin: org.apache.activemq/activemq-broker

@Override
public void messageExpired(ConnectionContext context, MessageReference message, Subscription subscription) {
  getNext().messageExpired(context, message, subscription);
}
origin: org.apache.activemq/activemq-osgi

@Override
public void messageExpired(ConnectionContext context, MessageReference message, Subscription subscription) {
  getNext().messageExpired(context, message, subscription);
}
origin: org.apache.activemq/activemq-all

@Override
public void messageExpired(ConnectionContext context, MessageReference message, Subscription subscription) {
  getNext().messageExpired(context, message, subscription);
}
origin: pierre/meteo

public void messageExpired(ConnectionContext context, MessageReference message, Subscription subscription) {
  getNext().messageExpired(context, message, subscription);
}
origin: pierre/meteo

public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("message expired: " + reference);
  }
  broker.messageExpired(context, reference, subs);
  destinationStatistics.getExpired().increment();
  try {
    removeMessage(context, subs, (QueueMessageReference) reference);
  } catch (IOException e) {
    LOG.error("Failed to remove expired Message from the store ", e);
  }
}
origin: org.apache.activemq/activemq-all

@Override
public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference) {
  LOG.debug("message expired: {}", reference);
  broker.messageExpired(context, reference, subs);
  destinationStatistics.getExpired().increment();
  try {
    removeMessage(context, subs, (QueueMessageReference) reference);
    messagesLock.writeLock().lock();
    try {
      messages.rollback(reference.getMessageId());
    } finally {
      messagesLock.writeLock().unlock();
    }
  } catch (IOException e) {
    LOG.error("Failed to remove expired Message from the store ", e);
  }
}
origin: org.apache.activemq/activemq-broker

@Override
public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference) {
  LOG.debug("message expired: {}", reference);
  broker.messageExpired(context, reference, subs);
  destinationStatistics.getExpired().increment();
  try {
    removeMessage(context, subs, (QueueMessageReference) reference);
    messagesLock.writeLock().lock();
    try {
      messages.rollback(reference.getMessageId());
    } finally {
      messagesLock.writeLock().unlock();
    }
  } catch (IOException e) {
    LOG.error("Failed to remove expired Message from the store ", e);
  }
}
origin: org.apache.activemq/activemq-osgi

@Override
public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference) {
  LOG.debug("message expired: {}", reference);
  broker.messageExpired(context, reference, subs);
  destinationStatistics.getExpired().increment();
  try {
    removeMessage(context, subs, (QueueMessageReference) reference);
    messagesLock.writeLock().lock();
    try {
      messages.rollback(reference.getMessageId());
    } finally {
      messagesLock.writeLock().unlock();
    }
  } catch (IOException e) {
    LOG.error("Failed to remove expired Message from the store ", e);
  }
}
origin: org.apache.activemq/activemq-broker

@Override
public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference) {
  broker.messageExpired(context, reference, subs);
  // AMQ-2586: Better to leave this stat at zero than to give the user
  // misleading metrics.
  // destinationStatistics.getMessages().decrement();
  destinationStatistics.getExpired().increment();
  MessageAck ack = new MessageAck();
  ack.setAckType(MessageAck.STANDARD_ACK_TYPE);
  ack.setDestination(destination);
  ack.setMessageID(reference.getMessageId());
  try {
    if (subs instanceof DurableTopicSubscription) {
      ((DurableTopicSubscription)subs).removePending(reference);
    }
    acknowledge(context, subs, ack, reference);
  } catch (Exception e) {
    LOG.error("Failed to remove expired Message from the store ", e);
  }
}
origin: pierre/meteo

public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference) {
  broker.messageExpired(context, reference, subs);
  // AMQ-2586: Better to leave this stat at zero than to give the user
  // misleading metrics.
  // destinationStatistics.getMessages().decrement();
  destinationStatistics.getEnqueues().decrement();
  destinationStatistics.getExpired().increment();
  MessageAck ack = new MessageAck();
  ack.setAckType(MessageAck.STANDARD_ACK_TYPE);
  ack.setDestination(destination);
  ack.setMessageID(reference.getMessageId());
  try {
    acknowledge(context, subs, ack, reference);
  } catch (IOException e) {
    LOG.error("Failed to remove expired Message from the store ", e);
  }
}
org.apache.activemq.brokerBrokermessageExpired

Javadoc

A Message has Expired

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

  • Start an intent from android
  • setContentView (Activity)
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • JCheckBox (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top Vim plugins
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