Ejemplo n.º 1
0
  @Override
  protected void processDelivery(Delivery delivery) {
    final MessageDelivery md = (MessageDelivery) delivery.getContext();
    if (delivery.remotelySettled()) {
      if (delivery.getTag().length > 0) {
        checkinTag(delivery.getTag());
      }

      final DeliveryState state = delivery.getRemoteState();
      if (state == null || state instanceof Accepted) {
        if (!delivery.remotelySettled()) {
          delivery.disposition(new Accepted());
        }
      } else if (state instanceof Rejected) {
        // re-deliver /w incremented delivery counter.
        md.delivery = null;
        md.incrementDeliveryCount();
        outbound.addLast(md);
      } else if (state instanceof Released) {
        // re-deliver && don't increment the counter.
        md.delivery = null;
        outbound.addLast(md);
      } else if (state instanceof Modified) {
        Modified modified = (Modified) state;
        if (modified.getDeliveryFailed()) {
          // increment delivery counter..
          md.incrementDeliveryCount();
        }
      }
      delivery.settle();
    }
    md.fireWatches();
  }
Ejemplo n.º 2
0
  static {
    MODIFIED_FAILED.setDeliveryFailed(true);

    MODIFIED_FAILED_UNDELIVERABLE.setDeliveryFailed(true);
    MODIFIED_FAILED_UNDELIVERABLE.setUndeliverableHere(true);
  }