Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring Cloud-SQS-此wsdl版本的指定队列不存在_Spring_Amazon Web Services_Annotations_Amazon Sqs_Spring Cloud - Fatal编程技术网

Spring Cloud-SQS-此wsdl版本的指定队列不存在

Spring Cloud-SQS-此wsdl版本的指定队列不存在,spring,amazon-web-services,annotations,amazon-sqs,spring-cloud,Spring,Amazon Web Services,Annotations,Amazon Sqs,Spring Cloud,我正在尝试让SpringCloud使用自动配置来处理消息传递 我的属性文件包含: cloud.aws.credentials.accessKey=xxxxxxxxxx cloud.aws.credentials.secretKey=xxxxxxxxxx cloud.aws.region.static=us-west-2 我的配置类如下: @EnableSqs @ComponentScan @EnableAutoConfiguration public class Application {

我正在尝试让SpringCloud使用自动配置来处理消息传递

我的属性文件包含:

cloud.aws.credentials.accessKey=xxxxxxxxxx
cloud.aws.credentials.secretKey=xxxxxxxxxx

cloud.aws.region.static=us-west-2
我的配置类如下:

@EnableSqs
@ComponentScan
@EnableAutoConfiguration
public class Application {


public static void main(String[] args) throws Exception {
    SpringApplication.run(Application.class, args);
  }
}
我的侦听器类:

@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());

    }
}
然而,当我运行这个。我得到以下错误:

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

还有人碰到这个吗?非常感谢您提供任何帮助。

此错误意味着指定的队列orderQueue在us-west-2区域不存在。只要创造它,它就会工作


顺便说一句,使用@EnableAutoConfiguration时不需要添加@EnableSqs

尝试使用队列的URL,而不是名称。

在尝试使用命令行获取队列URL时,我遇到了相同的问题。看看我有什么:

 A client error (AWS.SimpleQueueService.NonExistentQueue) occurred when calling the GetQueueUrl operation: The specified queue does not exist for this wsdl version.
必须运行以下命令:

$aws configure
并在提示“默认区域名称[…]:”下输入了我的队列所属的区域。然后错误消失了


因此,请仔细检查您的配置;)

阿兰的回答是正确的。此错误表示该队列在us-west-2区域中不存在。原因之一可能是AWS Java SDK使用us-east-1作为默认区域。来自AWS文档

如果未在代码中指定区域,AWS SDK for Java将使用us-east-1作为默认区域。但是,AWS管理控制台使用us-west-2作为默认设置。因此,在将AWS管理控制台与开发结合使用时,请确保在代码和控制台中指定相同的区域

您可以使用
setRegion()
setEndpoint()
对象的
AmazonSQSClient
方法在客户端中专门设置区域或端点。看


有关区域和端点的列表,请参见

在重新创建同名队列后,我也出现了此错误,创建新队列是立即的解决方案,因为我不确定新ARN连接需要多长时间。

因此,我验证了队列仍然位于us-west-2区域,并且错误仍然存在。当我删除@EnableSqs时,错误消失了,但是它没有连接到队列。对我来说就是这样,只是我引用了ARN而不是QueuePolicy中的URL。你解决了这个问题吗?我也有同样的问题。唯一的区别是它在我的机器上工作,但在我的机器上不工作ec2@user123475我也面临同样的问题。我能够从我的机器而不是EC2连接。有什么帮助吗?