You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2009/07/01 19:48:07 UTC

[jira] Commented: (CAMEL-1756) getEndpoint() should match for singleton endpoints even if url does not contain params

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

Claus Ibsen commented on CAMEL-1756:
------------------------------------

Hadrian I do not think we can let getEndpoint(url) lookup singleton endpoints, stripped its parameters.

Many endpoints is singleton in Camel but have parameters. And parameters matter to this endpoint. For instance I can have 2 singleton endpoints for mail.
{code}
mail://mymailserver.com?username=claus&password=cheese
mail://mymailserver.com?username=hadrian&password=beer
{code}

They are both singletons but the are different. So if I want to poll my mailbox I can grap the endpoint with the username=claus and use it to get my mail.
But you need to get the other endpoint to poll and get your mail.

What we cannot do is to have a single shared endpoint
{code}
mail://mymaiserver.com
{code}
That we can both use to get our mails. As we need to configure it after we got it to set username/password etc. And then we mutate the single shared instance.
So when you grap it later its pre configure with parameters from last usage.



> getEndpoint() should match for singleton endpoints even if url does not contain params
> --------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1756
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1756
>             Project: Apache Camel
>          Issue Type: Improvement
>    Affects Versions: 1.6.1, 2.0-M2
>            Reporter: Hadrian Zbarcea
>            Assignee: Hadrian Zbarcea
>             Fix For: 1.6.2, 2.0.0
>
>
> When one uses endpoint injection, if the url does not exactly match, the CamelContext will not find the endpoint (and create a new one).
> I think singleton Endpoint(s) should not be registered with the full url, just with the url stripped of parameters, since they are mostly configuration and not necessarily relevant to the producer.  Also if the configuration of a singleton endpoint will change slightly, an update/recompile of the producer code is no longer necessary.
> I cannot think of a situation in which this improvement would cause problems.  I have a fix for this but I'll wait a few days.  Thoughts?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.