private String createMessagingErrorMessage(String description, Object payload) { return description + "\n" + "Endpoint handler details:\n" + "Method [" + this.handlerAdapter.getMethodAsString(payload) + "]\n" + "Bean [" + this.handlerAdapter.getBean() + "]"; }
private String createMessagingErrorMessage(String description, Object payload) { return description + "\n" + "Endpoint handler details:\n" + "Method [" + this.handlerAdapter.getMethodAsString(payload) + "]\n" + "Bean [" + this.handlerAdapter.getBean() + "]"; }
/** * Invoke the handler, wrapping any exception to a {@link ListenerExecutionFailedException} * with a dedicated error message. * @param amqpMessage the raw message. * @param channel the channel. * @param message the messaging message. * @return the result of invoking the handler. */ private InvocationResult invokeHandler(org.springframework.amqp.core.Message amqpMessage, Channel channel, Message<?> message) { try { return this.handlerAdapter.invoke(message, amqpMessage, channel); } catch (MessagingException ex) { throw new ListenerExecutionFailedException(createMessagingErrorMessage("Listener method could not " + "be invoked with the incoming message", message.getPayload()), ex, amqpMessage); } catch (Exception ex) { throw new ListenerExecutionFailedException("Listener method '" + this.handlerAdapter.getMethodAsString(message.getPayload()) + "' threw exception", ex, amqpMessage); } }
/** * Invoke the handler, wrapping any exception to a {@link ListenerExecutionFailedException} * with a dedicated error message. * @param amqpMessage the raw message. * @param channel the channel. * @param message the messaging message. * @return the result of invoking the handler. */ private InvocationResult invokeHandler(org.springframework.amqp.core.Message amqpMessage, Channel channel, Message<?> message) { try { return this.handlerAdapter.invoke(message, amqpMessage, channel); } catch (MessagingException ex) { throw new ListenerExecutionFailedException(createMessagingErrorMessage("Listener method could not " + "be invoked with the incoming message", message.getPayload()), ex, amqpMessage); } catch (Exception ex) { throw new ListenerExecutionFailedException("Listener method '" + this.handlerAdapter.getMethodAsString(message.getPayload()) + "' threw exception", ex, amqpMessage); } }