【问题标题】:Amazon SQS Outbound channel adapter won't initializeAmazon SQS 出站通道适配器不会初始化
【发布时间】:2016-10-04 06:11:23
【问题描述】:

我正在尝试启动一个正在写入 SQS 队列的 spring-int-aws 流,但不会加载上下文。

Error starting ApplicationContext. To display the auto-configuration report
re-run your application with 'debug' enabled.
2016-10-03 14:10:51.848 ERROR 3741 --- [           main]     
o.s.boot.SpringApplication               : Application startup failed

org.springframework.beans.factory.BeanCreationException: Error creating bean     
with name 'org.springframework.integration.aws.outbound.SqsMessageHandler#0':    
Bean instantiation via constructor failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate  
[org.springframework.integration.aws.outbound.SqsMessageHandler]: Constructor 
threw exception; nested exception is java.lang.NoSuchMethodError: 
org.springframework.cloud.aws.messaging.core.QueueMessagingTemplate.<init
(Lcom/amazonaws/services/sqs/AmazonSQS;Lorg/springframework/cloud/aws/core/env/ResourceIdResolver;)V
....

做了一些研究:在 SQSMessageHandler (v 1.0.0-RELEASE) 内部,它尝试使用已声明的 AmazonSQS 对象创建 QueueMessagingTemplate,但是 QueueMessagingTemplate (v1.1.3 Release) 它需要构造函数中的 AmazonSQSAsync 对象。由于 spring-cloud-aws 使用子接口,看来 spring-int-aws 也应该如此。

我是否遗漏了什么,或者这应该是针对项目提出的问题?

【问题讨论】:

    标签: spring-integration spring-cloud-aws


    【解决方案1】:

    spring-integration-aws 是针对 1.1.1 构建的。

    请在那里打开一个问题,以便我们进行兼容的构建。

    也就是说,Spring 项目在单点发布中破坏 API 是很不寻常的,所以我们也应该为 spring-cloud-aws 提出一个问题,要求他们恢复另一个 ctor(如果可能),并交叉链接问题。

    I opened issues.

    在 spring-integration-aws 中执行任何操作之前,我们会等待该问题的处理(但我们仍应继续并支持异步选项)。

    【讨论】:

    • 谢谢@GaryRussell 我将在 spring-int-aws 方面发布 PR。基于 sprint-cloud-aws 中的更改,进行更改是为了让超时实际用作发送超时而不是 SQS 消息延迟,因此在某些时候我们可能希望它使用 Async 接口,如入站适配器。
    猜你喜欢
    • 2018-07-06
    • 2016-05-28
    • 2016-07-19
    • 1970-01-01
    • 2015-07-11
    • 2012-11-25
    • 1970-01-01
    • 1970-01-01
    • 2013-09-09
    相关资源
    最近更新 更多