You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2015/07/12 20:59:05 UTC

[jira] [Comment Edited] (CAMEL-4596) enrich and pollEnrich should accept an expression for dynamic uris

    [ https://issues.apache.org/jira/browse/CAMEL-4596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14623947#comment-14623947 ] 

Claus Ibsen edited comment on CAMEL-4596 at 7/12/15 6:58 PM:
-------------------------------------------------------------

We can do this in a way that would break the api slightly but make enrich / pollEnrich similar to recipientList where you use an expression for the endpoint. Then its similar

Today
{code}
<pollEnrich timeout="5000" uri="seda:mustBeHardcodedValue"/>
{code}

In the future
{code}
<pollEnrich timeout="5000">
   <simple>seda:${header.queueName}</simple>
</pollEnrich>
{code}

You can still use constant uris
{code}
<pollEnrich timeout="5000">
   <constant>seda:fixedName</constant>
</pollEnrich>
{code}

That means XML users need to migrate the code. However as this is the top wanted change, I think its worth-while the breaking. 
Users of Java DSL we can preserve the behavior as we got the power of Java code to adapt.


was (Author: davsclaus):
We can do this in a way that would break the api slightly but make enrich / pollEnrich similar to recipientList where you use an expression for the endpoint. Then its similar

Today
{code}
<pollEnrich timeout="5000" uri="seda:mustBeHardcodedValue">
{code}

In the future
{code}
<pollEnrich timeout="5000">
   <simple>seda:${header.queueName}</simple>
</pollEnrich>
{code}

You can still use constant uris
{code}
<pollEnrich timeout="5000">
   <constant>seda:fixedName</constant>
</pollEnrich>
{code}

That means XML users need to migrate the code. However as this is the top wanted change, I think its worth-while the breaking. 
Users of Java DSL we can preserve the behavior as we got the power of Java code to adapt.

> enrich and pollEnrich should accept an expression for dynamic uris
> ------------------------------------------------------------------
>
>                 Key: CAMEL-4596
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4596
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core, eip
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.16.0, 3.0.0
>
>
> We should consider using an expression for uri's for the enrich and pollEnrich EIP's so we can poll from a dynamic computed endpoint.
> However it will break API as currently the uri is mandatory.
> It's a bit the same problem with to EIP which is also static uri. However for to EIP we have recipientList which is the dynamic to.
> So we need a similar dynamic for enrich and pollEnrich. 
> This also solves the problem with that people wan't to provide details from the current exchange in the endpoint uri. We have a ticket for that.
> eg enrich("file:inbox?fileName=${header.nameToPickUp}")
> So if we can do it using an expression it could be
> .enrich().simple("file:inbox?fileName=${header.nameToPickUp}")
> See nabble
> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-tp4939908p4939908.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)