Spring Cloud - SQS - The specified queue does not exist for this wsdl version

65,186

Solution 1

This error means that the specified queue orderQueue does not exist on region us-west-2. Just create it and it should work.

Btw, there's no need to add _@EnableSqs_ when using _@EnableAutoConfiguration_.

Solution 2

Alain's answer is correct. This error indicates that the queue doesn't exist in the region us-west-2. One of the reasons could be that the AWS Java SDK uses us-east-1 as the default region. From AWS documentation http://docs.aws.amazon.com/java-sdk/latest/developer-guide/java-dg-region-selection.html

The AWS SDK for Java uses us-east-1 as the default region if you do not specify a region in your code. However, the AWS Management Console uses us-west-2 as its default. Therefore, when using the AWS Management Console in conjunction with your development, be sure to specify the same region in both your code and the console.

You can set the region or end point specifically in the client using setRegion() or setEndpoint() methods of AmazonSQSClientobject. See http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/sqs/AmazonSQS.html#setEndpoint-java.lang.String-

For a list of region and endpoints see http://docs.aws.amazon.com/general/latest/gr/rande.html#sqs_region

Solution 3

Try using URL of the queue, instead of the name.

Solution 4

I've impacted the same issue while trying to get-queue-url using command line. Look what I had:

 A client error (AWS.SimpleQueueService.NonExistentQueue) occurred when calling the GetQueueUrl operation: The specified queue does not exist for this wsdl version.

Had to run this:

$aws configure

And under prompt 'Default region name[...]:' entered the region than my queue belongs to. Then the error disappeared.

So double check your configs ;)

Share:
65,186

Related videos on Youtube

polomarco
Author by

polomarco

Updated on March 28, 2022

Comments

  • polomarco
    polomarco about 2 years

    I am attempting to get spring cloud to work with messaging using auto configure.

    My properties file contains:

    cloud.aws.credentials.accessKey=xxxxxxxxxx
    cloud.aws.credentials.secretKey=xxxxxxxxxx
    
    cloud.aws.region.static=us-west-2
    

    My Configuration class is as follows:

    @EnableSqs
    @ComponentScan
    @EnableAutoConfiguration
    public class Application {
    
    
    public static void main(String[] args) throws Exception {
        SpringApplication.run(Application.class, args);
      }
    }
    

    My Listener class:

    @RestController
    public class OrderListener {
    
        @MessageMapping("orderQueue")
        public void orderListener(Order order){
    
            System.out.println("Order Name " + order.getName());
            System.out.println("Order Url" + order.getUrl());
    
        }
    }
    

    However, when I run this. I get the following error:

    org.springframework.context.ApplicationContextException: Failed to start bean        'simpleMessageListenerContainer'; nested exception is     org.springframework.messaging.core.DestinationResolutionException: The specified queue does not exist for this wsdl version. (Service: AmazonSQS; Status Code: 400; Error Code: AWS.SimpleQueueService.NonExistentQueue; Request ID: cc8cb199-be88-5993-bd58-fca3c9f17110); nested exception is com.amazonaws.services.sqs.model.QueueDoesNotExistException: The specified queue does not exist for this wsdl version. (Service: AmazonSQS; Status Code: 400; Error Code: AWS.SimpleQueueService.NonExistentQueue; Request ID: cc8cb199-be88-5993-bd58-fca3c9f17110)
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:176)
    at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:51)
    at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:346)
    at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:149)
    at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:112)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:770)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:140)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:961)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:950)
    at com.releasebot.processor.Application.main(Application.java:40)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
    
    Caused by: org.springframework.messaging.core.DestinationResolutionException: The specified queue does not exist for this wsdl version. (Service: AmazonSQS; Status Code: 400; Error Code: AWS.SimpleQueueService.NonExistentQueue; Request ID: cc8cb199-be88-5993-bd58-fca3c9f17110); nested exception is com.amazonaws.services.sqs.model.QueueDoesNotExistException: The specified queue does not exist for this wsdl version. (Service: AmazonSQS; Status Code: 400; Error Code: AWS.SimpleQueueService.NonExistentQueue; Request ID: cc8cb199-be88-5993-bd58-fca3c9f17110)
    at org.springframework.cloud.aws.messaging.support.destination.DynamicQueueUrlDestinationResolver.resolveDestination(DynamicQueueUrlDestinationResolver.java:81)
    at org.springframework.cloud.aws.messaging.support.destination.DynamicQueueUrlDestinationResolver.resolveDestination(DynamicQueueUrlDestinationResolver.java:37)
    at org.springframework.messaging.core.CachingDestinationResolverProxy.resolveDestination(CachingDestinationResolverProxy.java:88)
    at org.springframework.cloud.aws.messaging.listener.AbstractMessageListenerContainer.start(AbstractMessageListenerContainer.java:300)
    at org.springframework.cloud.aws.messaging.listener.SimpleMessageListenerContainer.start(SimpleMessageListenerContainer.java:38)
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:173)
    ... 18 common frames omitted
    

    Anyone else run across this? Any help would be greatly appreciated

    • user123475
      user123475 about 6 years
      Did you resolve this issue? I am having the same issue. The only difference is it works on my machine but it does not in ec2
    • Sumanth Varada
      Sumanth Varada over 4 years
      @user123475 I'm facing the same issue. I was able to connect from my machine not from EC2. Any help ?
  • polomarco
    polomarco over 9 years
    So I verified that the queue was still in region us-west-2 and the error was still there. When i removed @EnableSqs the error went away, however it did not connect to the queue.
  • Sector95
    Sector95 over 7 years
    This was the case for me, except I was referencing the ARN instead of the URL in the QueuePolicy.