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

Babak Vahdat commented on CAMEL-6250:
-------------------------------------

Thanks for the patch Christian.

Just wonder if we should add some logic to {{DefaultEndpoint#setId()}} to *make 
sure* the Id has not been already assigned to another endpoint object bound to 
the *same* {{CamelContext}}. The user could mistakenly assign the same Id value 
to different endpoints and I think we should catch this and inform him about 
this mistake using e.g. {{EndpointIdAlreadyAssignedException}} and whatnot. The 
implementation of the required logic could be as easy as iterating and 
verifying the Ids of all {{DefaultEndpoint}} objects bound to the 
{{camelContext}} instance variable of this class (e.g. using the 
{{CamelContext#getEndpoints()}} API).

Or maybe even better would be to provide all this duplicate-check logic to 
{{EndpointHelper}} utility itself?
                
> Setting id on endpoint in <from> may not work
> ---------------------------------------------
>
>                 Key: CAMEL-6250
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6250
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-spring
>    Affects Versions: 2.10.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.10.7, 2.11.2, 2.12.0
>
>         Attachments: CAMEL-6250.patch
>
>
> See nabble
> http://camel.465427.n5.nabble.com/How-to-get-Id-of-an-Endpoint-tp5730470.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to