Apache Camel RabbitMQ X-Expires Аргумент - PullRequest
0 голосов
/ 28 февраля 2019

У меня возникли проблемы с объявлением обмена и временной очереди с использованием компонента Camel RabbitMQ с указанным аргументом x-expires.Моя конечная точка выглядит следующим образом:

rabbitmq:MyExchange?args=arg.queue.x-expires=10000&autoDelete=true&exchangeType=direct&routingKey=MyRoutingKey

, и я получаю эту ошибку

Caused by: java.lang.IllegalArgumentException: Could not find a suitable setter for property: args as there isn't a setter method with same type: java.lang.String nor type conversion possible: No type converter available to convert from type: java.lang.String to the required type: java.util.Map with value arg.queue.x-expires=1000
    at org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:618) ~[camel-core-2.23.1.jar:2.23.1]
    at org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:649) ~[camel-core-2.23.1.jar:2.23.1]
    at org.apache.camel.util.IntrospectionSupport.setProperties(IntrospectionSupport.java:491) ~[camel-core-2.23.1.jar:2.23.1]
    at org.apache.camel.util.IntrospectionSupport.setProperties(IntrospectionSupport.java:501) ~[camel-core-2.23.1.jar:2.23.1]
    at org.apache.camel.util.EndpointHelper.setProperties(EndpointHelper.java:254) ~[camel-core-2.23.1.jar:2.23.1]
    at org.apache.camel.impl.DefaultComponent.setProperties(DefaultComponent.java:309) ~[camel-core-2.23.1.jar:2.23.1]
    at org.apache.camel.impl.DefaultComponent.setProperties(DefaultComponent.java:297) ~[camel-core-2.23.1.jar:2.23.1]
    at org.apache.camel.component.rabbitmq.RabbitMQComponent.createEndpoint(RabbitMQComponent.java:248) ~[camel-rabbitmq-2.23.1.jar:2.23.1]
    at org.apache.camel.component.rabbitmq.RabbitMQComponent.createEndpoint(RabbitMQComponent.java:34) ~[camel-rabbitmq-2.23.1.jar:2.23.1]
    at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:126) ~[camel-core-2.23.1.jar:2.23.1]
    at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:706) ~[camel-core-2.23.1.jar:2.23.1]
    ... 3 more

Глядя на компонент RabbitMQ Camel документация , я обнаружил, что аргументы требуют меняуказать Map<String, Object> в качестве аргументов, но я не могу найти, где в документации Camel сделать это.Есть ли способ указать время истечения очереди, чтобы она автоматически удалялась / истекла по истечении этого времени?

...