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

Claus Ibsen commented on CAMEL-4226:
------------------------------------

Frankly sometimes its best to post on @dev before opening a ticket.

Anyway end users should use the EIPs supplied. And the recipient list is the 
dynamic EIP.
There is a FAQ as well
http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

We should also be careful to not overload the DSL with new options etc. as it 
just confuses end users as they get a huge list in the IDE when accessing code 
completion.

Likewise we should keep the DSL in sync between Java, XML and Scala (later is a 
bit more hard). But the Java and XML is in sync due the JAXB models. And you 
cannot with JAXB define that an expression should be *optional* so you can keep 
doing
<to uri="xxx"/> in XML.

This is not possible and you get a validation exception as it would expect an 
expression, so you would have to do
<to>
  <constant>xxx</constant>
</to>

Which is ugly/verbose, and breaks every Camel applications that are using XML 
DSL.

I dont think its a good idea to add this only to Java DSL, as we have end users 
who migrate between Java and XML. Likewise its best they are 1:1.



> add Expressions support on to(), bean() and beanRef() to allow for dynamic 
> endpints (similar to recipientList)
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4226
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4226
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Ben O'Day
>            Assignee: Ben O'Day
>            Priority: Minor
>             Fix For: 2.9.0
>
>
> just a thought, but any reason we couldn't overload these APIs to also 
> support Expressions?  Is there another way to do this?
> to(simple("bean:myBean?method=${headers.operationName}"))
> bean(MyBean.class, simple("${headers.operationName}"))
> beanRef("myBean", simple("${headers.operationName}"))
> The goal being to make it (slighlty) easier/more flexible than using 
> recipientList for the same...
> recipientList(simple("bean:myBean?method=${headers.operationName}"))

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to