public Released newInstance(Object described) { return Released.getInstance(); }
public Released newInstance(Object described) { return Released.getInstance(); }
public Released newInstance(Object described) { return Released.getInstance(); }
public Released newInstance(Object described) { return Released.getInstance(); }
/** * Release the given delivery by applying Released disposition state, and optionally settling. * * @param delivery * the delivery to update * @param settle * whether to settle * @return the delivery */ public static ProtonDelivery released(ProtonDelivery delivery, boolean settle) { delivery.disposition(Released.getInstance(), settle); return delivery; }
private byte deduceEncodingCode(Disposition value, int elementCount) { if (value.getState() == null) { return EncodingCodes.LIST8; } else if (value.getState() == Accepted.getInstance() || value.getState() == Released.getInstance()) { return EncodingCodes.LIST8; } else { return EncodingCodes.LIST32; } }
delivery.disposition(Released.getInstance()); delivery.settle(); return;
private void releasePrefetch() { Delivery delivery = getEndpoint().head(); while (delivery != null) { Delivery current = delivery; delivery = delivery.next(); if (current.getContext() instanceof JmsInboundMessageDispatch) { JmsInboundMessageDispatch envelope = (JmsInboundMessageDispatch) current.getContext(); if (!envelope.isDelivered()) { handleDisposition(envelope, current, Released.getInstance()); } } else { LOG.debug("{} Found incomplete delivery with no context during release processing", AmqpConsumer.this); } } }
private void releasePrefetch() { Delivery delivery = getEndpoint().head(); while (delivery != null) { Delivery current = delivery; delivery = delivery.next(); if (current.getContext() instanceof JmsInboundMessageDispatch) { JmsInboundMessageDispatch envelope = (JmsInboundMessageDispatch) current.getContext(); if (!envelope.isDelivered()) { handleDisposition(envelope, current, Released.getInstance()); } } else { LOG.debug("{} Found incomplete delivery with no context during release processing", AmqpConsumer.this); } } }
/** * Sends acknowledgement of this message using the provided ACK_TYPE. * @param ackType acknowledgement type to send */ public void acknowledge(ACK_TYPE ackType) { switch(ackType) { // Codes_SRS_AMQPSMESSAGE_14_001: [If the ACK_TYPE is COMPLETE, the function shall set an Accepted disposition on the private Delivery object.] case COMPLETE: _delivery.disposition(Accepted.getInstance()); break; // Codes_SRS_AMQPSMESSAGE_14_002: [If the ACK_TYPE is ABANDON, the function shall set a Released disposition on the private Delivery object.] case ABANDON: _delivery.disposition(Released.getInstance()); break; // Codes_SRS_AMQPSMESSAGE_14_003: [If the ACK_TYPE is REJECT, the function shall set a Rejected disposition on the private Delivery object.] case REJECT: _delivery.disposition(new Rejected()); break; default: //This should never happen throw new IllegalStateException("Invalid ack type given. Type "+ ackType +" does not exist."); } // Codes_SRS_AMQPSMESSAGE_14_005: [The function shall settle the delivery after setting the proper disposition.] _delivery.settle(); }
/** * Sends acknowledgement of this message using the provided ACK_TYPE. * @param ackType acknowledgement type to send */ public void acknowledge(ACK_TYPE ackType) { switch(ackType) { // Codes_SRS_AMQPSMESSAGE_14_001: [If the ACK_TYPE is COMPLETE, the function shall set an Accepted disposition on the private Delivery object.] case COMPLETE: _delivery.disposition(Accepted.getInstance()); break; // Codes_SRS_AMQPSMESSAGE_14_002: [If the ACK_TYPE is ABANDON, the function shall set a Released disposition on the private Delivery object.] case ABANDON: _delivery.disposition(Released.getInstance()); break; // Codes_SRS_AMQPSMESSAGE_14_003: [If the ACK_TYPE is REJECT, the function shall set a Rejected disposition on the private Delivery object.] case REJECT: _delivery.disposition(new Rejected()); break; default: //This should never happen throw new IllegalStateException("Invalid ack type given. Type "+ ackType +" does not exist."); } // Codes_SRS_AMQPSMESSAGE_14_005: [The function shall settle the delivery after setting the proper disposition.] _delivery.settle(); }
@Override public void run() { checkClosed(); try { if (!delivery.isSettled()) { delivery.disposition(Released.getInstance()); delivery.settle(); session.pumpToProtonTransport(request); } request.onSuccess(); } catch (Exception e) { request.onFailure(e); } } });
Delivery envelope = new DeliveryImpl(message, delivery, connCtx); if(!subscription.onNextWrapper(envelope)){ delivery.disposition(Released.getInstance(), true);
break; case RELEASED: handleDisposition(envelope, delivery, Released.getInstance()); break; case MODIFIED_FAILED:
break; case RELEASED: handleDisposition(envelope, delivery, Released.getInstance()); break; case MODIFIED_FAILED:
break; case RELEASED: disposition = Released.getInstance(); break; case REJECTED:
break; case RELEASED: disposition = Released.getInstance(); break; case REJECTED:
delivery.disposition(Released.getInstance()); delivery.settle(); return;
@Override public ProtonReceiver createReceiver(String address, ProtonLinkOptions receiverOptions) { Receiver receiver = session.receiver(getOrCreateLinkName(receiverOptions)); Symbol[] outcomes = new Symbol[] { Accepted.DESCRIPTOR_SYMBOL, Rejected.DESCRIPTOR_SYMBOL, Released.DESCRIPTOR_SYMBOL, Modified.DESCRIPTOR_SYMBOL }; Source source = new Source(); source.setAddress(address); source.setOutcomes(outcomes); source.setDefaultOutcome(Released.getInstance()); if(receiverOptions.isDynamic()) { source.setDynamic(true); } Target target = new Target(); receiver.setSource(source); receiver.setTarget(target); ProtonReceiverImpl r = new ProtonReceiverImpl(receiver); r.openHandler((result) -> { LOG.trace("Receiver open completed"); }); r.closeHandler((result) -> { if (result.succeeded()) { LOG.trace("Receiver closed"); } else { LOG.warn("Receiver closed with error", result.cause()); } }); // Default to at-least-once r.setQoS(ProtonQoS.AT_LEAST_ONCE); return r; }
private boolean processDelivery(Delivery incoming) throws Exception { incoming.setDefaultDeliveryState(Released.getInstance());