You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Leber, Thomas" <th...@omnetric.com> on 2018/02/20 12:27:30 UTC
Context and RouteID as properties in From configuration
Hi,
we want to create from tags in XML with information from the RouteID and the Context name. I tried it in this way
<from uri="activemq:topic:mytopic?clientId={{context:name}}-{{route:Id}}-{{env:computername}}&durableSubscriptionName={{context:name}}-{{route:Id}}-{{env:computername}}" />
I know I can get the route ID in a simple statement in the route inflight but this does not work since this is evaluated during runtime and the from is a startup configuration.
Is there any build-in way to do this, or do I need to implement a custom resolver?
Best,
Thomas
Re: Context and RouteID as properties in From configuration
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Ah yeah that is no possible. We could consider having the properties
resolver support the context name, or maybe just register the context
name in a JVM system property. However the latter implies a single
camel context in the JVM which only works in some runtimes like spring
boot or standalone.
So a custom function resolver in properties placeholder is maybe the way to go.
On Tue, Feb 20, 2018 at 1:27 PM, Leber, Thomas
<th...@omnetric.com> wrote:
> Hi,
>
> we want to create from tags in XML with information from the RouteID and the Context name. I tried it in this way
>
> <from uri="activemq:topic:mytopic?clientId={{context:name}}-{{route:Id}}-{{env:computername}}&durableSubscriptionName={{context:name}}-{{route:Id}}-{{env:computername}}" />
>
> I know I can get the route ID in a simple statement in the route inflight but this does not work since this is evaluated during runtime and the from is a startup configuration.
> Is there any build-in way to do this, or do I need to implement a custom resolver?
>
> Best,
> Thomas
>
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2