Exemplo n.º 1
0
  /** Take message from SQS */
  private List<QueueMessage> take() {

    final Timer.Context timer = this.readTimer.time();

    try {
      return queue.getMessages(MAX_TAKE, AsyncEvent.class);
    } finally {
      // stop our timer
      timer.stop();
    }
  }
Exemplo n.º 2
0
  /** Ack message in SQS */
  public void ack(final List<QueueMessage> messages) {

    final Timer.Context timer = this.ackTimer.time();

    try {
      queue.commitMessages(messages);

      // decrement our in-flight counter
      inFlight.decrementAndGet();

    } catch (Exception e) {
      throw new RuntimeException("Unable to ack messages", e);
    } finally {
      timer.stop();
    }
  }
Exemplo n.º 3
0
  public String getQueueManagerClass() {

    return queue.getClass().getSimpleName();
  }
Exemplo n.º 4
0
 @Override
 public long getQueueDepth() {
   return queue.getQueueDepth();
 }