@Override public void processRemoteClose(AmqpProvider provider) throws IOException { // For unsubscribe we care if the remote signaled an error on the close since // that would indicate that the unsubscribe did not succeed and we want to throw // that from the unsubscribe call. if (getEndpoint().getRemoteCondition().getCondition() != null) { closeResource(provider, AmqpSupport.convertToException(provider, getEndpoint(), getEndpoint().getRemoteCondition()), true); } else { closeResource(provider, null, true); } }
@Override public void processRemoteClose(AmqpProvider provider) throws IOException { // For unsubscribe we care if the remote signaled an error on the close since // that would indicate that the unsubscribe did not succeed and we want to throw // that from the unsubscribe call. if (getEndpoint().getRemoteCondition().getCondition() != null) { closeResource(provider, AmqpSupport.convertToException(provider, getEndpoint(), getEndpoint().getRemoteCondition()), true); } else { closeResource(provider, null, true); } }
? String.format(Locale.US, "onDelivery linkName[%s], updatedLinkCredit[%s], remoteCredit[%s], " + "remoteCondition[%s], delivery.isSettled[%s]", receiveLink.getName(), receiveLink.getCredit(), receiveLink.getRemoteCredit(), receiveLink.getRemoteCondition(), delivery.isSettled()) : String.format(Locale.US, "delivery.isSettled[%s]", delivery.isSettled())); String.format(Locale.US, "onDelivery linkName[%s], updatedLinkCredit[%s], remoteCredit[%s], " + "remoteCondition[%s], delivery.isPartial[%s]", receiveLink.getName(), receiveLink.getCredit(), receiveLink.getRemoteCredit(), receiveLink.getRemoteCondition(), delivery.isPartial()));
@Override public void inspectOpenedResource(Receiver receiver) { ErrorCondition condition = receiver.getRemoteCondition(); if (condition != null && condition.getCondition() != null) { if (!condition.getCondition().equals(AmqpError.UNAUTHORIZED_ACCESS)) { markAsInvalid("Should have been tagged with unauthorized access error"); } } else { markAsInvalid("Receiver should have been opened with an error"); } } });
private void onLinkOpenComplete(final Exception exception) { if (openRefCount.decrementAndGet() <= 0 && onOpen != null) if (exception == null && this.sendLink.getRemoteState() == EndpointState.ACTIVE && this.receiveLink.getRemoteState() == EndpointState.ACTIVE) onOpen.onComplete(null); else { if (exception != null) onOpen.onError(exception); else { final ErrorCondition error = (this.sendLink.getRemoteCondition() != null && this.sendLink.getRemoteCondition().getCondition() != null) ? this.sendLink.getRemoteCondition() : this.receiveLink.getRemoteCondition(); onOpen.onError(ExceptionUtil.toException(error)); } } }
@Override public void onDelivery(Event event) { synchronized (this.firstResponse) { if (this.isFirstResponse) { this.isFirstResponse = false; this.amqpReceiver.onOpenComplete(null); } } Delivery delivery = event.getDelivery(); Receiver receiveLink = (Receiver) delivery.getLink(); TRACE_LOGGER.debug("onDelivery: linkName:{}, updatedLinkCredit:{}, remoteCredit:{}, remoteCondition:{}, delivery.isPartial:{}", receiveLink.getName(), receiveLink.getCredit(), receiveLink.getRemoteCredit(), receiveLink.getRemoteCondition(), delivery.isPartial()); //TODO: What happens when a delivery has no message, but only disposition from the remote link? Like when ServiceBus service sends just a disposition to the receiver?" // If a message spans across deliveries (for ex: 200k message will be 4 frames (deliveries) 64k 64k 64k 8k), // all until "last-1" deliveries will be partial // reactor will raise onDelivery event for all of these - we only need the last one if (!delivery.isPartial()) { this.amqpReceiver.onReceiveComplete(delivery); } } }
String receiverError = event.getReceiver() != null && event.getReceiver().getRemoteCondition() != null && event.getReceiver().getRemoteCondition().getCondition() != null ? event.getReceiver().getRemoteCondition().getCondition().toString() : ""; String sessionError = event.getSession() != null && event.getSession().getRemoteCondition() != null && event.getSession().getRemoteCondition().getCondition() != null ? event.getSession().getRemoteCondition().getCondition().toString() : ""; String connectionError = event.getConnection() != null && event.getConnection().getRemoteCondition() != null && event.getConnection().getRemoteCondition().getCondition() != null ? event.getConnection().getRemoteCondition().getCondition().toString() : ""; String receiverErrorDescription = event.getReceiver() != null && event.getReceiver().getRemoteCondition() != null && event.getReceiver().getRemoteCondition().getDescription() != null ? event.getReceiver().getRemoteCondition().getDescription() : ""; String sessionErrorDescription = event.getSession() != null && event.getSession().getRemoteCondition() != null && event.getSession().getRemoteCondition().getDescription() != null ? event.getSession().getRemoteCondition().getDescription() : ""; String connectionErrorDescription = event.getConnection() != null && event.getConnection().getRemoteCondition() != null && event.getConnection().getRemoteCondition().getDescription() != null ? event.getConnection().getRemoteCondition().getDescription() : "";