Я пытаюсь представить Hystrix в своем Spring Project, однако, когда я добавляю следующую зависимость в мой pom (пробовал с 1.4.4 до последней версии 2.1.1):
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
<version>2.1.1.RELEASE</version>
</dependency>
Я получаюследующее исключение:
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route queue-name-consumer: Route(queue-name-consumer)[[From[aws-sqs://u... because of The specified queue does not exist or you do not have access to it. (Service: AmazonSQS; Status Code: 400; Error Code: AWS.SimpleQueueService.NonExistentQueue)
at org.apache.camel.impl.RouteService.warmUp(RouteService.java:147) ~[camel-core-2.22.2.jar:2.22.2]
at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3949) ~[camel-core-2.22.2.jar:2.22.2]
at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3856) ~[camel-core-2.22.2.jar:2.22.2]
at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3642) ~[camel-core-2.22.2.jar:2.22.2]
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3494) ~[camel-core-2.22.2.jar:2.22.2]
at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:209) ~[camel-core-2.22.2.jar:2.22.2]
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3253) ~[camel-core-2.22.2.jar:2.22.2]
at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3272) ~[camel-core-2.22.2.jar:2.22.2]
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3249) ~[camel-core-2.22.2.jar:2.22.2]
Я использую: - Spring Boot 2.0.5 - Camel 2.22.2 - AWS-Java-SDK 1.11.381
Мои очереди SQS настроены в моемПриложение Spring в формате
@Configuration
public class QueueConfig implements CamelContextAware {
private final AmazonSQSAsync amazonSQSClient;
private CamelContext camelContext;
@Autowired
public QueueConfig(AmazonSQSAsync amazonSQSClient) {
this.amazonSQSClient = amazonSQSClient;
}
@Override
public void setCamelContext(CamelContext camelContext) {
this.camelContext = camelContext;
}
@Override
public CamelContext getCamelContext() {
return camelContext;
}
@Bean(name = "ExampleListenerBean)
public MessageListener<Exchange> amazonMessageListener(
RequestHandler handler,
Acknowledger<AmazonMessage> acknowledger) {
MessageListener<Exchange> listener =
new AmazonMessageListener<>(handler, acknowledger, new CamelSQSMessageConverter());
return listener;
}
@Bean(name = "ExampleRequestRouteDefinition")
public RouteBuilder exampleRouteDefinition(
@Qualifier(ExampleListenerBean) MessageListener<Exchange> listener) {
SqsQueueRouteProps properties =
SqsQueueRouteProps.main("queueDefinition", "path-to-queue").build();
String queue = properties.getFullQueueName();
return SqsQueueRouteBuilder.newBuilder(queue, amazonSQSClient, listener, getCamelContext())
.withRouteName("example-route-name")
.withProperties(properties)
.build();
}
Эта настройка все работает без зависимости Hystrix, я не уверен, какие несовместимости искать здесь, сообщение об ошибке вводит в заблуждение, потому что существуют очереди, где-то есть конфликтНе могу найти.