hash (pound sign) notation in Camel 3.x

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

hash (pound sign) notation in Camel 3.x

Vojtech Fried-2
Hi,

in Camel 2.x I used a #<name> notation in URIs for endpoints. I used the #<name> for example for passwords, because passwords can contain any characters and I don't want any Camel processing on it. I used SimpleRegistry to add objects and somehow plugged it into Camel context and then looked those object by name with #<name>. It does not seem to work in 3.x. The replacement for this seems to be ${ref:<name>} notation. But it works differently, at least for my "toD" URIs. If I put a String into the registry and reference it with "ref:", it is somehow processed by Camel when it normalizes URIs, I think properties are looked up if the string contains something like {{name}}.

Is there any documentation on "#" or "ref"? Was "#" replaced with "ref" in 3.x or is it some problem in my environment? I haven't found it in migration to 3 docs.

/Vojtech
Reply | Threaded
Open this post in threaded view
|

Re: hash (pound sign) notation in Camel 3.x

Claus Ibsen-2
Hi

You should use #bean:xxx to refer to a bean in the registry by its id.
https://github.com/apache/camel/commit/763bfeb999f1fa7a3a3f1ef96c7a7eefa2032734

On Fri, Jun 5, 2020 at 1:56 PM Vojtech Fried
<[hidden email]> wrote:
>
> Hi,
>
> in Camel 2.x I used a #<name> notation in URIs for endpoints. I used the #<name> for example for passwords, because passwords can contain any characters and I don't want any Camel processing on it. I used SimpleRegistry to add objects and somehow plugged it into Camel context and then looked those object by name with #<name>. It does not seem to work in 3.x. The replacement for this seems to be ${ref:<name>} notation. But it works differently, at least for my "toD" URIs. If I put a String into the registry and reference it with "ref:", it is somehow processed by Camel when it normalizes URIs, I think properties are looked up if the string contains something like {{name}}.
>
> Is there any documentation on "#" or "ref"? Was "#" replaced with "ref" in 3.x or is it some problem in my environment? I haven't found it in migration to 3 docs.
>
> /Vojtech



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: hash (pound sign) notation in Camel 3.x

Vojtech Fried-2
Thanks. Works perfectly.

________________________________
From: Claus Ibsen <[hidden email]>
Sent: Sunday, June 7, 2020 10:01
To: [hidden email] <[hidden email]>
Subject: [EXTERNAL] - Re: hash (pound sign) notation in Camel 3.x

Hi

You should use #bean:xxx to refer to a bean in the registry by its id.
https://urldefense.com/v3/__https://github.com/apache/camel/commit/763bfeb999f1fa7a3a3f1ef96c7a7eefa2032734__;!!Obbck6kTJA!P57o44tdLPjkMBevUjgX2hR98fYAijroozT90KDqfGVRXVzdFKKgDHAxegBR-O_0$

On Fri, Jun 5, 2020 at 1:56 PM Vojtech Fried
<[hidden email]> wrote:
>
> Hi,
>
> in Camel 2.x I used a #<name> notation in URIs for endpoints. I used the #<name> for example for passwords, because passwords can contain any characters and I don't want any Camel processing on it. I used SimpleRegistry to add objects and somehow plugged it into Camel context and then looked those object by name with #<name>. It does not seem to work in 3.x. The replacement for this seems to be ${ref:<name>} notation. But it works differently, at least for my "toD" URIs. If I put a String into the registry and reference it with "ref:", it is somehow processed by Camel when it normalizes URIs, I think properties are looked up if the string contains something like {{name}}.
>
> Is there any documentation on "#" or "ref"? Was "#" replaced with "ref" in 3.x or is it some problem in my environment? I haven't found it in migration to 3 docs.
>
> /Vojtech



--
Claus Ibsen
-----------------
https://urldefense.com/v3/__http://davsclaus.com__;!!Obbck6kTJA!P57o44tdLPjkMBevUjgX2hR98fYAijroozT90KDqfGVRXVzdFKKgDHAxevVC1KEJ$  @davsclaus
Camel in Action 2: https://urldefense.com/v3/__https://www.manning.com/ibsen2__;!!Obbck6kTJA!P57o44tdLPjkMBevUjgX2hR98fYAijroozT90KDqfGVRXVzdFKKgDHAxejVYAWjR$
Reply | Threaded
Open this post in threaded view
|

Re: hash (pound sign) notation in Camel 3.x

Jeremy Ross
See this FAQ entry for more info:
https://camel.apache.org/manual/latest/faq/how-do-i-configure-endpoints.html#HowdoIconfigureendpoints-ReferringbeansfromEndpointURIs

On Mon, Jun 8, 2020 at 3:06 AM Vojtech Fried <[hidden email]>
wrote:

> Thanks. Works perfectly.
>
> ________________________________
> From: Claus Ibsen <[hidden email]>
> Sent: Sunday, June 7, 2020 10:01
> To: [hidden email] <[hidden email]>
> Subject: [EXTERNAL] - Re: hash (pound sign) notation in Camel 3.x
>
> Hi
>
> You should use #bean:xxx to refer to a bean in the registry by its id.
>
> https://urldefense.com/v3/__https://github.com/apache/camel/commit/763bfeb999f1fa7a3a3f1ef96c7a7eefa2032734__;!!Obbck6kTJA!P57o44tdLPjkMBevUjgX2hR98fYAijroozT90KDqfGVRXVzdFKKgDHAxegBR-O_0$
>
> On Fri, Jun 5, 2020 at 1:56 PM Vojtech Fried
> <[hidden email]> wrote:
> >
> > Hi,
> >
> > in Camel 2.x I used a #<name> notation in URIs for endpoints. I used the
> #<name> for example for passwords, because passwords can contain any
> characters and I don't want any Camel processing on it. I used
> SimpleRegistry to add objects and somehow plugged it into Camel context and
> then looked those object by name with #<name>. It does not seem to work in
> 3.x. The replacement for this seems to be ${ref:<name>} notation. But it
> works differently, at least for my "toD" URIs. If I put a String into the
> registry and reference it with "ref:", it is somehow processed by Camel
> when it normalizes URIs, I think properties are looked up if the string
> contains something like {{name}}.
> >
> > Is there any documentation on "#" or "ref"? Was "#" replaced with "ref"
> in 3.x or is it some problem in my environment? I haven't found it in
> migration to 3 docs.
> >
> > /Vojtech
>
>
>
> --
> Claus Ibsen
> -----------------
>
> https://urldefense.com/v3/__http://davsclaus.com__;!!Obbck6kTJA!P57o44tdLPjkMBevUjgX2hR98fYAijroozT90KDqfGVRXVzdFKKgDHAxevVC1KEJ$
> @davsclaus
> Camel in Action 2:
> https://urldefense.com/v3/__https://www.manning.com/ibsen2__;!!Obbck6kTJA!P57o44tdLPjkMBevUjgX2hR98fYAijroozT90KDqfGVRXVzdFKKgDHAxejVYAWjR$
>