Example usage for org.springframework.data.redis.listener.adapter RedisListenerExecutionFailedException RedisListenerExecutionFailedException

List of usage examples for org.springframework.data.redis.listener.adapter RedisListenerExecutionFailedException RedisListenerExecutionFailedException

Introduction

In this page you can find the example usage for org.springframework.data.redis.listener.adapter RedisListenerExecutionFailedException RedisListenerExecutionFailedException.

Prototype

public RedisListenerExecutionFailedException(String msg, Throwable cause) 

Source Link

Document

Constructs a new RedisListenerExecutionFailedException instance.

Usage

From source file:org.springframework.data.redis.listener.adapter.MessageListenerAdapter.java

/**
 * Invoke the specified listener method.
 * /*from  w w w  . j ava  2  s.c  o  m*/
 * @param methodName the name of the listener method
 * @param arguments the message arguments to be passed in
 * @see #getListenerMethodName
 */
protected void invokeListenerMethod(String methodName, Object[] arguments) {
    try {
        invoker.invoke(arguments);
    } catch (InvocationTargetException ex) {
        Throwable targetEx = ex.getTargetException();
        if (targetEx instanceof DataAccessException) {
            throw (DataAccessException) targetEx;
        } else {
            throw new RedisListenerExecutionFailedException(
                    "Listener method '" + methodName + "' threw exception", targetEx);
        }
    } catch (Throwable ex) {
        throw new RedisListenerExecutionFailedException("Failed to invoke target method '" + methodName
                + "' with arguments " + ObjectUtils.nullSafeToString(arguments), ex);
    }
}