14

Sto tentando di far funzionare il cloud di primavera con i messaggi utilizzando la configurazione automatica.Spring Cloud - SQS - La coda specificata non esiste per questa versione wsdl

mio file delle proprietà contiene:

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

cloud.aws.region.static=us-west-2 

La mia classe di configurazione è la seguente:

@EnableSqs 
@ComponentScan 
@EnableAutoConfiguration 
public class Application { 


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

La mia classe Listener:

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

    } 

} 

Tuttavia, quando eseguo questo. Ottengo il seguente errore:

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 

Chiunque altro run in tutto questo? Qualsiasi aiuto sarebbe molto apprezzato

risposta

10

Questo errore significa che la coda specificata orderQueue non esiste sulla regione noi-ovest-2. Basta crearlo e dovrebbe funzionare.

Btw, non c'è bisogno di aggiungere @EnableSqs quando si utilizza @EnableAutoConfiguration.

+0

Così ho verificato che la coda era ancora nella regione di noi-ovest-2 e l'errore era ancora lì. Quando ho rimosso @EnableSqs, l'errore è andato via, ma non si collegava alla coda. – polomarco

4

Provare a utilizzare l'URL della coda, anziché il nome.

+0

Questo è stato il mio caso, tranne che mi riferivo all'ARN anziché all'URL in QueuePolicy. – Sector95

1

ho influenzato lo stesso problema durante il tentativo di get-coda-url utilizzando riga di comando. Guardate quello che avevo:

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

dovuto correre questo:

$aws configure 

E sotto prompt 'nome della regione di default [...]:' entrati nella regione della mia coda appartiene. Quindi l'errore è scomparso.

Quindi doppio controllare i file di configurazione;)

4

risposta di Alain è corretto. Questo errore indica che la coda non esiste nella regione us-west-2. Uno dei motivi potrebbe essere che AWS Java SDK utilizza us-east-1 come area predefinita. Dalla documentazione AWS 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.

È possibile impostare il punto di regione o fine in particolare nel client utilizzando setRegion() o setEndpoint() metodi di AmazonSQSClient oggetto. Vedere http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/sqs/AmazonSQS.html#setEndpoint-java.lang.String-

Per un elenco di regione e gli endpoint vedere http://docs.aws.amazon.com/general/latest/gr/rande.html#sqs_region

Problemi correlati