0

I am looking to amend the RouteDefination from in Apache Camel

I hav eproperties file as below test1=test queue1=queue

code as below

from( "activemq:queue:{{test1}}.{{queue1}}")
.transform()
.simple(" ${body} {{test1}}.{{queue1}}.hello ${date:now:yyyyMMdd}")
.to("stream:out");

this will become for route as

from( "activemq:queue:test1.queue")

i am looking to make it as

from( "activemq:queue:test1.queue_20170606")

which is ${date:now:yyyyMMdd}

Mike
  • 615
  • 1
  • 6
  • 10
  • 1
    It is not clear what is a purpose to do that? Do you try to create new queue every day? for what? Maybe it is good to revise your system design? – Vadim Jun 08 '17 at 13:39

1 Answers1

0

This is not possible in Camel - the from endpoint is static.

However ActiveMQ supports queue wildcards which you can use to consume from multiple queues, and you can use JMS message selectors.

The latter is not so performant as it needs to do a query on the queue.

If you want to do a route per yyyyMMdd, then you need to add/remove routes dynamic in Camel. See other questions on SO how to do that.

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65