Spring Cloud Stream @SendTo Annotation not working

后端 未结 1 867
我寻月下人不归
我寻月下人不归 2021-01-14 17:04

I\'m using Spring Cloud Stream with Spring Boot. My application is very simple:

ExampleService.class:

@EnableBinding(Processor1.class)
@Service
publi         


        
相关标签:
1条回答
  • 2021-01-14 17:08

    What leads you to believe that @SendTo on its own is supported? @SendTo is a secondary annotation used by many projects, not just Spring Cloud Stream; as far as I know, there is nothing that will look for it on its own.

    Try Spring Integration's @Publisher annotation instead (with @EnablePublisher).

    EDIT

    To force proxying with CGLIB instead of a JDK proxy, you can do this...

    @Bean
    public static BeanFactoryPostProcessor bfpp() {
        return bf -> {
            bf.getBean(IntegrationContextUtils.PUBLISHER_ANNOTATION_POSTPROCESSOR_NAME,
                    PublisherAnnotationBeanPostProcessor.class).setProxyTargetClass(true);
        };
    }
    
    0 讨论(0)
提交回复
热议问题