Spring Cloud Stream 3.0.1 adding Channel Interceptor around @Input annotation

橙三吉。 提交于 2020-05-17 07:06:21

问题


I am looking for a way to intercept the @Input annotation and add an interceptor for my Subscribable Channel

Something like below

@Around("@annotation(org.springframework.cloud.stream.annotation.Input)")
public Object interceptInput(ProceedingJoinPoint joinPoint) throws Throwable {
    LOG.debug("Intercepted @Input from method : {}", joinPoint.getSignature());

    Object returnValue = null;

    try {
        returnValue = joinPoint.proceed();
        // add the interceptor for input channel
    } catch (Exception e) {
        LOG.warn("@Input error", e);
    }

    return returnValue;
}

What can i do (near the comment) to achieve this? Any other options also are welcome

来源:https://stackoverflow.com/questions/61775840/spring-cloud-stream-3-0-1-adding-channel-interceptor-around-input-annotation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!