コード例 #1
0
ファイル: AmqpSender.java プロジェクト: sdnnfv/qpid
  @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();
  }
コード例 #2
0
ファイル: AmqpSupport.java プロジェクト: tabish121/qpid-jms
  static {
    MODIFIED_FAILED.setDeliveryFailed(true);

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