Cannot Resolve SqsListener
I am trying to create sqs listener and the @SqsListenter is not resolving in STS. I am not sure what I am missing on my pom. Adding spring-cloud-aws-autoconfigure does not help.
Thanks in advance!
My pom has the following dependencies
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-aws</artifactId>
<version>${spring-cloud-aws-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-aws-messaging</artifactId>
<version>${spring-cloud-aws-version}</version>
</dependency>
Class package com.boelter.integration.listener.beercup;
import com.amazonaws.services.sqs.AmazonSQS; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cloud.aws.messaging.core.QueueMessagingTemplate; import org.springframework.messaging.support.MessageBuilder; import org.springframework.cloud.aws.messaging.core.*;
public class BeercupQuotesListener {
@SqsListener("quotes") <--- THIS IS WHAT IS NOT RESOLVING
public void queueListener(String message) {
// ...
}
}
Hello @donaldhook , is your class registered in the spring application (e.g. by using @Component or any other component annotation) ?
It looks like the 1.0.x release simply doesn't have the listener.annotation package build into it for some reason. I downloaded every version on Maven Central (1.0.0 through 1.0.4) and none of them have a listener.annotation directory.
Hello @soverby the @SqsListener annotation has been introduced in 1.1, if you are using 1.0.x you have to use the org.springframework.messaging.handler.annotation.MessageMapping annotation (which does not support any deletion mode)