您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

如何配置自定义Spring Cloud AWS SimpleMessageListenerContainerFactory,使其与@SqsListener一起使用

如何配置自定义Spring Cloud AWS SimpleMessageListenerContainerFactory,使其与@SqsListener一起使用

不确定您错过了什么,但是针对这种用例进行了准确的测试:

@EnableSqs
@Configuration
public static class ConfigurationWithCustomContainerFactory {


    @Bean
    public SimpleMessageListenerContainerFactory simpleMessageListenerContainerFactory() {
        SimpleMessageListenerContainerFactory factory = new SimpleMessageListenerContainerFactory();
        factory.setAmazonSqs(amazonSQS());
        ...
        return factory;
    }

    @Bean
    public AmazonSQSAsync amazonSQS() {
        return AMAZON_SQS;
    }

}

因此,@EnaqbleSqs仍在此处,SqsConfiguration并且@Autowired与您的自定义项相同SimpleMessageListenerContainerFactory@Bean

Java 2022/1/1 18:21:48 有637人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶