Spring Cloud - SQS - Die angegebene Warteschlange existiert nicht für diese wsdl-version
Ich bin versucht zu bekommen Frühling cloud-arbeiten mit der messaging mithilfe der automatischen konfigurieren.
Meine properties-Datei enthält:
cloud.aws.credentials.accessKey=xxxxxxxxxx
cloud.aws.credentials.secretKey=xxxxxxxxxx
cloud.aws.region.static=us-west-2
Meine Konfiguration Klasse ist wie folgt:
@EnableSqs
@ComponentScan
@EnableAutoConfiguration
public class Application {
public static void main(String[] args) throws Exception {
SpringApplication.run(Application.class, args);
}
}
Mein Listener-Klasse:
@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());
}
}
Allerdings, wenn ich diese laufen. Ich bekomme die folgende Fehlermeldung:
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
Jemand anderes laufen über diese? Jegliche Hilfe würde sehr geschätzt werden
InformationsquelleAutor der Frage polomarco | 2015-01-22
Du musst angemeldet sein, um einen Kommentar abzugeben.
Dieser Fehler bedeutet, dass die angegebene Warteschlange orderQueue existiert nicht auf region us-west-2. Erstellen Sie einfach und es sollte funktionieren.
Btw, es gibt keine Notwendigkeit zum hinzufügen von @EnableSqs bei der Verwendung @EnableAutoConfiguration.
InformationsquelleAutor der Antwort Alain
Versuchen Sie es mit der URL der queue, statt der Namen.
InformationsquelleAutor der Antwort Selva
Alains Antwort richtig ist. Dieser Fehler zeigt an, dass die Warteschlange nicht vorhanden sind, in der region us-west-2. Einer der Gründe könnte sein, dass die AWS Java SDK verwendet, us-east-1 als Standard-region. AWS-Dokumentation http://docs.aws.amazon.com/java-sdk/latest/developer-guide/java-dg-region-selection.html
Können Sie die region oder Ende zeigen speziell, dass der client
setRegion()
odersetEndpoint()
Methoden derAmazonSQSClient
Objekt. Sehen http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/sqs/AmazonSQS.html#setEndpoint-java.lang.String-Für eine Liste der region-und Endpunkte siehe http://docs.aws.amazon.com/general/latest/gr/rande.html#sqs_region
InformationsquelleAutor der Antwort factotum
Habe ich auf das gleiche Problem beim Versuch zu get-queue-url Verwendung von Befehlszeile. Schauen Sie, was ich hatte:
Hatte, um dies ausführen:
Und unter Eingabeaufforderung 'Default name der region[...]:' trat die region als meine Warteschlange gehört. Dann ist der Fehler verschwunden.
So überprüfen Sie Ihre configs 😉
InformationsquelleAutor der Antwort user1520978