1

I'm trying to start up a spring-int-aws flow that is writing to an SQS queue, but the context won't load.

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
....

Did some research: Inside of the SQSMessageHandler (v 1.0.0-RELEASE) it's attempting to create a QueueMessagingTemplate using a declared AmazonSQS object, however the QueueMessagingTemplate (v1.1.3 Release) it requires an AmazonSQSAsync object in the constructor. Since spring-cloud-aws uses the sub-interface, it seems that spring-int-aws should as well.

Am I missing something, or should this be an issue filed against the project?

MikeG
  • 23
  • 3

1 Answers1

1

spring-integration-aws is built against 1.1.1.

Please open an issue there so we can make a compatible build.

That said, it's pretty unusual for Spring projects to break APIs in a point release, so we should raise an issue for spring-cloud-aws too, to ask them to restore the other ctor (if possible), and cross-link the issues.

I opened issues.

We would wait for the disposition of that issue before doing anything in spring-integration-aws (but we should still go ahead and support the async option).

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • Thank you, @GaryRussell I'll issue a PR on the spring-int-aws side. Based on the change in sprint-cloud-aws, the change was made to get timeouts to actually work as a send timeout rather than an SQS message delay, so at some point we'd probably want that to use the Async interface like the inbound adapter. – MikeG Oct 04 '16 at 15:28