title: Not able to read messages from SQS using @SqsListener
body: <p>I'm trying to develop a SQS Listener which runs in background and reads message from AWS SQS whenever a new message arrives and it should never delete the message, since there will be a separate process for deleting message.</p>
  
  <p>This is a standalone application, just started developing. But not able to proceed further since the basic thing is not working. I'm sure I'm missing something. I am using <strong>spring-cloud-aws-messaging (version: 1.2.0.BUILD-SNAPSHOT).</strong></p>
  
  <p>It's a very simple standalone application, having below files:
  <strong>One spring config file: application-context.xml (content already pasted above)
  One SQS Listener: SBSQSMessageListener (content already pasted above)
  One main program which is loading the application-context.xml &amp; creating ApplicationContext</strong></p>
  
  <p><strong>My Spring config file:</strong></p>
  
  <pre><code>&lt;aws-context:context-region region="us-west-2"/&gt;
  
  &lt;aws-context:context-credentials&gt;
      &lt;aws-context:simple-credentials access-key="xxxxxxx" secret-key="xxxxxxxxxxxxx" /&gt;
  &lt;/aws-context:context-credentials&gt;
  
  &lt;aws-messaging:queue-messaging-template id="queueMessagingTemplate" /&gt;      
  
  &lt;aws-messaging:annotation-driven-queue-listener task-executor="simpleTaskExecutor" /&gt;           
  
  &lt;bean id="simpleTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"&gt;
      &lt;property name="corePoolSize" value="4" /&gt;
      &lt;property name="maxPoolSize" value="10" /&gt;
      &lt;property name="queueCapacity" value="1" /&gt;
      &lt;property name="WaitForTasksToCompleteOnShutdown" value="true" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>My SQSListener:</p>
  
  <pre><code>package sb.aws.sqs.listener;
  
  import java.util.concurrent.ExecutionException;
  import org.apache.log4j.Logger;
  import org.springframework.cloud.aws.messaging.config.annotation.EnableSqs;
  import org.springframework.cloud.aws.messaging.listener.annotation.SqsListener;
  import org.springframework.cloud.aws.messaging.listener.Acknowledgment;
  import org.springframework.cloud.aws.messaging.listener.SqsMessageDeletionPolicy;
  import org.springframework.messaging.handler.annotation.MessageMapping;
  import org.springframework.stereotype.Component;
  
  @Component
  @EnableSqs
  public class SBSQSMessageListener {
  
  final static Logger logger = Logger.getLogger(SBSQSMessageListener.class);  
  
  @MessageMapping("sb-sqs-queue1")    
  @SqsListener(value = "sb-sqs-queue1", deletionPolicy = SqsMessageDeletionPolicy.NEVER)    
  public void receive(String message, Acknowledgment acknowledgment)  {
  
      System.out.println("Inside receive: " + message);       
  
      try {
          acknowledgment.acknowledge().get();
      } catch (InterruptedException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (ExecutionException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  }
  }
  </code></pre>
  
  <p>I'm getting below exception:</p>
  
  <blockquote>
    <p>DT:02/17/2017 15:20:20 LL:DEBUG hostname: storeId: txnId:
    CL:DefaultListableBeanFactory MSG:Creating shared instance of
    singleton bean 'simpleMessageListenerContainer' DT:02/17/2017 15:20:20
    LL:DEBUG hostname: storeId: txnId: CL:DefaultListableBeanFactory
    MSG:Creating instance of bean 'simpleMessageListenerContainer'
    DT:02/17/2017 15:20:20 LL:DEBUG hostname: storeId: txnId:
    CL:DefaultListableBeanFactory MSG:Returning cached instance of
    singleton bean
    'org.springframework.cloud.aws.messaging.config.annotation.SqsConfiguration'
    DT:02/17/2017 15:20:20 LL:DEBUG hostname: storeId: txnId:
    CL:DefaultListableBeanFactory MSG:Returning cached instance of
    singleton bean 'amazonSQSAsync' DT:02/17/2017 15:20:20 LL:DEBUG
    hostname: storeId: txnId: CL:DefaultListableBeanFactory MSG:Creating
    shared instance of singleton bean 'amazonSQS' DT:02/17/2017 15:20:20
    LL:DEBUG hostname: storeId: txnId: CL:DefaultListableBeanFactory
    MSG:Creating instance of bean 'amazonSQS' DT:02/17/2017 15:20:20
    LL:DEBUG hostname: storeId: txnId: CL:DefaultListableBeanFactory
    MSG:Returning cached instance of singleton bean
    'org.springframework.cloud.aws.messaging.config.annotation.SqsClientConfiguration'
    DT:02/17/2017 15:20:21 LL:DEBUG hostname: storeId: txnId:
    CL:DefaultListableBeanFactory MSG:Eagerly caching bean 'amazonSQS' to
    allow for resolving potential circular references DT:02/17/2017
    15:20:21 LL:DEBUG hostname: storeId: txnId:
    CL:DefaultListableBeanFactory MSG:Finished creating instance of bean
    'amazonSQS' Exception in thread "main"
    org.springframework.beans.factory.UnsatisfiedDependencyException:
    Error creating bean with name 'simpleMessageListenerContainer' defined
    in class path resource
    [org/springframework/cloud/aws/messaging/config/annotation/SqsConfiguration.class]:
    Unsatisfied dependency expressed through constructor argument with
    index 0 of type [com.amazonaws.services.sqs.AmazonSQSAsync]: : No
    qualifying bean of type [com.amazonaws.services.sqs.AmazonSQSAsync] is
    defined: expected single matching bean but found 2:
    amazonSQSAsync,amazonSQS; nested exception is
    org.springframework.beans.factory.NoUniqueBeanDefinitionException: No
    qualifying bean of type [com.amazonaws.services.sqs.AmazonSQSAsync] is
    defined: expected single matching bean but found 2:
    amazonSQSAsync,amazonSQS  at
    org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
      at
    org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:464)
      at
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1111)
      at
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1006)
      at
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
      at
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
      at
    org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
      at
    org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at
    org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
      at
    org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      at
    org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
      at
    org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
      at
    org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
      at
    org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
      at
    org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93)
      at sb.aws.sqs.SBSQSMain.main(SBSQSMain.java:14)
    <strong>Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No
    qualifying bean of type [com.amazonaws.services.sqs.AmazonSQSAsync] is
    defined: expected single matching bean but found 2:
    amazonSQSAsync,amazonSQS</strong>    at
    org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1054)
      at
    org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
      at
    org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
      at
    org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
      ... 15 more</p>
  </blockquote>
  
  <p>Please could you guide me if I'm missing anything?</p>
  
  <p>Many Thanks.</p>