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

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

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

origin: apache/activemq

@Override
public boolean isExpired(MessageReference messageReference) {
  return getNext().isExpired(messageReference);
}
origin: apache/activemq

protected void doBrowseList(List<Message> browseList, int max, PendingList list, ReentrantReadWriteLock lock, ConnectionContext connectionContext, String name) throws Exception {
  List<MessageReference> toExpire = new ArrayList<MessageReference>();
  lock.readLock().lock();
  try {
    addAll(list.values(), browseList, max, toExpire);
  } finally {
    lock.readLock().unlock();
  }
  for (MessageReference ref : toExpire) {
    if (broker.isExpired(ref)) {
      LOG.debug("expiring from {}: {}", name, ref);
      messageExpired(connectionContext, ref);
    } else {
      lock.writeLock().lock();
      try {
        list.remove(ref);
      } finally {
        lock.writeLock().unlock();
      }
      ref.decrementReferenceCount();
    }
  }
}
origin: apache/activemq

@Override
public boolean recoverMessage(Message message) {
  recoveredAccumulator++;
  if ((recoveredAccumulator % 10000) == 0) {
    LOG.info("cursor for {} has recovered {} messages. {}% complete", new Object[]{ getActiveMQDestination().getQualifiedName(), recoveredAccumulator, new Integer((int) (recoveredAccumulator * 100 / totalMessageCount))});
  }
  // Message could have expired while it was being
  // loaded..
  message.setRegionDestination(Queue.this);
  if (message.isExpired() && broker.isExpired(message)) {
    toExpire.add(message);
    return true;
  }
  if (hasSpace()) {
    messagesLock.writeLock().lock();
    try {
      try {
        messages.addMessageLast(message);
      } catch (Exception e) {
        LOG.error("Failed to add message to cursor", e);
      }
    } finally {
      messagesLock.writeLock().unlock();
    }
    destinationStatistics.getMessages().increment();
    return true;
  }
  return false;
}
origin: apache/activemq

private void discardExpiredMessage(MessageReference reference) {
  LOG.debug("Discarding expired message {}", reference);
  if (reference.isExpired() && broker.isExpired(reference)) {
    ConnectionContext context = new ConnectionContext();
    context.setBroker(broker);
    ((Destination)reference.getRegionDestination()).messageExpired(context, null, new IndirectMessageReference(reference.getMessage()));
  }
}
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

if (broker.isExpired(ref)) {
  messageExpired(createConnectionContext(), ref);
} else {
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

if (broker.isExpired(node)) {
  regionDestination.messageExpired(context, this, node);
origin: apache/activemq

if (broker.isExpired(node)) {
  ((Destination)node.getRegionDestination()).messageExpired(context, this, node);
origin: pierre/meteo

public boolean isExpired(MessageReference messageReference) {
  return next.isExpired(messageReference);
}
origin: org.apache.activemq/activemq-broker

@Override
public boolean isExpired(MessageReference messageReference) {
  return getNext().isExpired(messageReference);
}
origin: org.apache.activemq/activemq-all

@Override
public boolean isExpired(MessageReference messageReference) {
  return getNext().isExpired(messageReference);
}
origin: org.apache.activemq/activemq-osgi

@Override
public boolean isExpired(MessageReference messageReference) {
  return getNext().isExpired(messageReference);
}
origin: pierre/meteo

public boolean isExpired(MessageReference messageReference) {
  return getNext().isExpired(messageReference);
}
origin: pierre/meteo

/**
 * In the queue case, mark the node as dropped and then a gc cycle will
 * remove it from the queue.
 * 
 * @throws IOException
 */
protected void acknowledge(final ConnectionContext context, final MessageAck ack, final MessageReference n) throws IOException {
  final Destination q = n.getRegionDestination();
  final QueueMessageReference node = (QueueMessageReference)n;
  final Queue queue = (Queue)q;
  
  if (n.isExpired()) {
    // sync with message expiry processing
    if (!broker.isExpired(n)) {
      LOG.warn("ignoring ack " + ack + ", for already expired message: " + n);
      return;
    }
  }
  queue.removeMessage(context, this, node, ack);
}
origin: org.apache.activemq/activemq-broker

private void discardExpiredMessage(MessageReference reference) {
  LOG.debug("Discarding expired message {}", reference);
  if (reference.isExpired() && broker.isExpired(reference)) {
    ConnectionContext context = new ConnectionContext();
    context.setBroker(broker);
    ((Destination)reference.getRegionDestination()).messageExpired(context, null, new IndirectMessageReference(reference.getMessage()));
  }
}
origin: org.apache.activemq/activemq-all

private void discardExpiredMessage(MessageReference reference) {
  LOG.debug("Discarding expired message {}", reference);
  if (reference.isExpired() && broker.isExpired(reference)) {
    ConnectionContext context = new ConnectionContext();
    context.setBroker(broker);
    ((Destination)reference.getRegionDestination()).messageExpired(context, null, new IndirectMessageReference(reference.getMessage()));
  }
}
origin: org.apache.activemq/activemq-osgi

private void discardExpiredMessage(MessageReference reference) {
  LOG.debug("Discarding expired message {}", reference);
  if (reference.isExpired() && broker.isExpired(reference)) {
    ConnectionContext context = new ConnectionContext();
    context.setBroker(broker);
    ((Destination)reference.getRegionDestination()).messageExpired(context, null, new IndirectMessageReference(reference.getMessage()));
  }
}
origin: pierre/meteo

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

@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();
  }
}
org.apache.activemq.brokerBrokerisExpired

Javadoc

Determine if a message has expired -allows default behaviour to be overriden - as the timestamp set by the producer can be out of sync with the broker

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

  • Making http post requests using okhttp
  • putExtra (Intent)
  • setScale (BigDecimal)
  • setContentView (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Top PhpStorm 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