/** * Sets an AMQP 1.0 message delivery state to either RELEASED in the case of a <em>ServerErrorException</em> or REJECTED in the * case of a <em>ClientErrorException</em>. In the REJECTED case, the supplied exception will provide * the error condition value and description as reason for rejection. * * @param t The service invocation exception. * @throws NullPointerException if error is {@code null}. */ void handleFailure(final Throwable t) { Objects.requireNonNull(t); final ErrorCondition condition = getErrorCondition(t); if (ServiceInvocationException.class.isInstance(t)) { final ServiceInvocationException error = (ServiceInvocationException) t; if (ServerErrorException.class.isInstance(error)) { ProtonHelper.released(delivery, true); } else { MessageHelper.rejected(delivery, condition); } } else { MessageHelper.rejected(delivery, condition); } }
/** * Settles the command message with the <em>released</em> outcome * and flows credit to the peer. * <p> * This method also finishes the OpenTracing span returned by * {@link #getCurrentSpan()}. * * @param credit The number of credits to flow to the peer. * @throws IllegalArgumentException if credit is negative. */ public void release(final int credit) { if (credit < 0) { throw new IllegalArgumentException("credit must be >= 0"); } ProtonHelper.released(delivery, true); currentSpan.log("released command for device"); currentSpan.log(Tags.ERROR.getKey()); if (credit > 0) { flow(credit); } currentSpan.finish(); }
ProtonHelper.released(delivery, true);
replyToAddress, message.getCorrelationId()); TracingHelper.logError(span, "response from peer released (no status code)"); ProtonHelper.released(delivery, true); } else { LOG.debug("received response [reply-to: {}, subject: {}, correlation ID: {}, status: {}]",