{
final AmqpMessage amqpMessage = (AmqpMessage) message.specification;
switch (amqpMessage) {
case OK : {
final IdlCommon.Ok okPayload = (Ok) message.payload;
final CompletionToken token = okPayload.getToken ();
this.transcript.traceDebugging ("processing the success (OK) response for pending request with token `%s`...", token.getMessageId ());
this.pendingRequests.succeed (token.getMessageId (), null);
}
break;
case NOK : {
final IdlCommon.NotOk nokPayload = (NotOk) message.payload;
final CompletionToken token = nokPayload.getToken ();
this.transcript.traceDebugging ("processing the failure (NOK) response for pending request with token `%s`...", token.getMessageId ());
this.pendingRequests.fail (token.getMessageId (), new Exception ("request failed"));
}
break;
case ERROR : {
final IdlCommon.Error errorPayload = (Error) message.payload;
final CompletionToken token = errorPayload.getToken ();
this.transcript.traceDebugging ("processing the failure (error) response for pending request with token `%s` with message `%s`...", token.getMessageId (), errorPayload.getErrorMessage ());
this.pendingRequests.fail (token.getMessageId (), new Exception (errorPayload.getErrorMessage ()));
}
break;
case CONSUME_REPLY : {
final AmqpPayloads.ConsumeReply consumePayload = (ConsumeReply) message.payload;
final CompletionToken token = consumePayload.getToken ();
this.transcript.traceDebugging ("processing the success (consumer reply) response for pending request with token `%s`...", token.getMessageId ());
this.pendingRequests.succeed (token.getMessageId (), null);
}
break;
case CANCEL_OK : {
final AmqpPayloads.CancelOkMessage cancelOkPayload = (CancelOkMessage) message.payload;
final String consumerIdentifier = cancelOkPayload.getConsumerTag ();