[
https://issues.apache.org/jira/browse/CAMEL-15815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ncasaux updated CAMEL-15815:
----------------------------
Description:
Hello,
I found something which seems unexpected with the enrich processor and Camel
3.6.0.
If you consider those 2 routes:
{code:java}
from(timer("foo"))
.setBody(constant("1"))
.enrich("seda://test-${body}");
from(timer("bar"))
.setBody(constant("2"))
.enrich(seda("test-${body}"));{code}
In the log, it says:
{code:java}
[mel-1) thread #6 - timer://bar] SedaEndpoint INFO Endpoint
seda://test-2 is using shared queue: seda://test-2 with size: 1000
[mel-1) thread #5 - timer://foo] SedaEndpoint INFO Endpoint
seda://test-$%7Bbody%7D is using shared queue: seda://test-$%7Bbody%7D with
size: 1000
{code}
So the route using the enrich with “EndpointRouteBuilder style” seems to
consider the endpoint URI as a “simple” expression (and resolves it), and the
other one like a “constant” expression (which is what I expected). In the first
case, it means that the endpoint is resolved for every exchange processed.
It’s possible to “force” the constant expression using this though:
{code:java}
from(timer("biz"))
.setBody(constant("3"))
.enrich().constant(seda("test-${body}"));{code}
Regards,
Nicolas
was:
Hello,
I found something which seems unexpected with the enrich processor and Camel
3.6.0.
If you consider those 2 routes:
{code:java}
from(timer("foo"))
.setBody(constant("1"))
.enrich("seda://test-${body}");
from(timer("bar"))
.setBody(constant("2"))
.enrich(seda("test-${body}"));{code}
In the log, it says:
{code:java}
[mel-1) thread #6 - timer://bar] SedaEndpoint INFO Endpoint
seda://test-2 is using shared queue: seda://test-2 with size: 1000
[mel-1) thread #5 - timer://foo] SedaEndpoint INFO Endpoint
seda://test-$%7Bbody%7D is using shared queue: seda://test-$%7Bbody%7D with
size: 1000
{code}
So the route using the enrich with “EndpointRouteBuilder style” seems to
consider the endpoint URI as a “simple” expression (and resolves it), and the
other one like a “constant” expression (which is what I expected). In the first
case, it means that the endpoint is resolved for every exchange processed.
It’s possible to “force” the constant expression using this though:
{code:java}
from(timer("biz"))
.setBody(constant("3"))
.enrich().constant(seda("test-${body}"));{code}
Regards,
Nicolas
> enricher endpoint
> -----------------
>
> Key: CAMEL-15815
> URL: https://issues.apache.org/jira/browse/CAMEL-15815
> Project: Camel
> Issue Type: Bug
> Components: came-core
> Affects Versions: 3.6.0
> Reporter: ncasaux
> Priority: Major
>
> Hello,
>
> I found something which seems unexpected with the enrich processor and Camel
> 3.6.0.
> If you consider those 2 routes:
>
> {code:java}
> from(timer("foo"))
> .setBody(constant("1"))
> .enrich("seda://test-${body}");
>
> from(timer("bar"))
> .setBody(constant("2"))
> .enrich(seda("test-${body}"));{code}
>
> In the log, it says:
> {code:java}
> [mel-1) thread #6 - timer://bar] SedaEndpoint INFO
> Endpoint seda://test-2 is using shared queue: seda://test-2 with size: 1000
> [mel-1) thread #5 - timer://foo] SedaEndpoint INFO
> Endpoint seda://test-$%7Bbody%7D is using shared queue:
> seda://test-$%7Bbody%7D with size: 1000
> {code}
>
> So the route using the enrich with “EndpointRouteBuilder style” seems to
> consider the endpoint URI as a “simple” expression (and resolves it), and the
> other one like a “constant” expression (which is what I expected). In the
> first case, it means that the endpoint is resolved for every exchange
> processed.
>
> It’s possible to “force” the constant expression using this though:
> {code:java}
> from(timer("biz"))
> .setBody(constant("3"))
> .enrich().constant(seda("test-${body}"));{code}
>
> Regards,
> Nicolas
--
This message was sent by Atlassian Jira
(v8.3.4#803005)