You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Hadrian Zbarcea (JIRA)" <ji...@apache.org> on 2009/06/24 19:34:35 UTC

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

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: 2.0-M2, 1.6.1
            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.


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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52587#action_52587 ] 

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

The seda and vm components now behave like jms queues so you can use the same queues if you refer with and without parameters.

trunk: 789703.
1.x: 789745.

> 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.


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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-1756:
-------------------------------

    Component/s: camel-core

> 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
>          Components: camel-core
>    Affects Versions: 1.6.1, 2.0-M2
>            Reporter: Hadrian Zbarcea
>            Assignee: Hadrian Zbarcea
>             Fix For: 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.


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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-1756:
----------------------------------

    Assignee: Claus Ibsen  (was: Hadrian Zbarcea)

> 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
>          Components: camel-core
>    Affects Versions: 1.6.1, 2.0-M2
>            Reporter: Hadrian Zbarcea
>            Assignee: Claus Ibsen
>             Fix For: 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.


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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52694#action_52694 ] 

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

Got the endpoint resolution improved now it caters for missing // in scheme and can match parameters that are not in the same order etc.

> 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
>          Components: camel-core
>    Affects Versions: 1.6.1, 2.0-M2
>            Reporter: Hadrian Zbarcea
>            Assignee: Claus Ibsen
>             Fix For: 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.


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

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52621#action_52621 ] 

Hadrian Zbarcea edited comment on CAMEL-1756 at 7/1/09 1:05 PM:
----------------------------------------------------------------

@Claus, yeah, that's what i was saying in a comment above.  However I sense we can do better.  Today for instance:
{code}
mail://mymailserver.com?username=claus&password=cheese
mail://mymailserver.com?password=cheese&username=claus
{code}
are considered different endpoints, I think, although they are obviously the same.

Should we force users to keep urls in sync as strings?  Maybe if we knew for an endpoint what params are used to make the endpoint unique, let's call them mandatory (yeah, bad name) params arrange them in a predefined order (alphabetically) and strip the others that have no relevance for the producer, but are consumer side configuration?

So then the following would be equivalent (assuming only username and password are mandatory for singleton uniqueness):
{code}
mail://mymailserver.com?password=cheese&username=claus // this being the key
mail://mymailserver.com?username=claus&password=cheese
mail://mymailserver.com?fetchSize=10&password=cheese&username=claus
{code}
but different than:
{code}
mail://mymailserver.com?password=bar&username=hadrian // this being another key
{code}

Just a though...

      was (Author: hadrian):
    @Claus, yeah, that's what i was saying in a comment above.  However I sense we can do better.  Today for instance:
{code}
mail://mymailserver.com?username=claus&password=cheese
mail://mymailserver.com?password=cheese&username=claus
{code}
are considered different endpoints, I think, although they are obviously the same.

Should we force users to keep urls in sync as strings?  Maybe if we knew for an endpoint what params are used to make the endpoint unique, let's call them mandatory (yeah, bad name) params arrange them in a predefined order (alphabetically) and strip the others that have no relevance for the producer, but are consumer side configuration?

So then the following would be equivalent
{code}
mail://mymailserver.com?password=cheese&username=claus // this being the key
mail://mymailserver.com?username=claus&password=cheese
mail://mymailserver.com?fetchSize=10&password=cheese&username=claus
{code}
but different then:
{code}
mail://mymailserver.com?password=bar&username=hadrian // this being another key
{code}

Just a though...
  
> 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.


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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-1756:
-------------------------------

    Fix Version/s:     (was: 1.6.2)

Only fixing for Camel 2.0

> 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
>          Components: camel-core
>    Affects Versions: 1.6.1, 2.0-M2
>            Reporter: Hadrian Zbarcea
>            Assignee: Hadrian Zbarcea
>             Fix For: 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.


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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ 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.


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

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52479#action_52479 ] 

Hadrian Zbarcea commented on CAMEL-1756:
----------------------------------------

@Claus, that's the thing.  You are correct, and I guess this is why we dodged this issue, I know it was discussed in the past.

However, I wonder if this is a realistic scenario.  I assume that for consumers, if one would need two endpoints, one with 5 concurrent consumers and one with 20, she would name them differently, something like "seda:foo?concurrentConsumers=5" and "seda:bar?concurrentConsumers=20".  On the producer side, I think it's more than unnecessary, it's bad practice in general (yeah, there are exceptions) to know or care about the consumer configuration.  If for some reason (like increased number of producers) one decides to change the consumer endpoint to have 10 concurrent consumers instead of 5, all the producers will need to be updated.

So the question is how do we define a singleton Endpoint?  If a restful api is designed to support urls like: "http://www.example.com/account?name=hadrian" instead of "http://www.example.com/account/hadrian" the change I propose will not work.

Another aspect is that even an endpoint is registered with a full url (including params), the @EndpointInject could still find it if the url specified does not have the params and the endpoint is a singleton. 

It almost seems like in addition to the url, an Endpoint has an id, which by default should be the url for non-singetons, the url stripped of params for singletons (maybe), and support a strategy (sorta the equivalent of the flag you mentioned) for special cases like above.  Or maybe the flag should only be for how EndpointInject finds the endpoint.  Not really sure.  I'd be happy though if we could improve this, because it's a bit of a nasty gray spot.




> 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.


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

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52621#action_52621 ] 

Hadrian Zbarcea commented on CAMEL-1756:
----------------------------------------

@Claus, yeah, that's what i was saying in a comment above.  However I sense we can do better.  Today for instance:
{code}
mail://mymailserver.com?username=claus&password=cheese
mail://mymailserver.com?password=cheese&username=claus
{code}
are considered different endpoints, I think, although they are obviously the same.

Should we force users to keep urls in sync as strings?  Maybe if we knew for an endpoint what params are used to make the endpoint unique, let's call them mandatory (yeah, bad name) params arrange them in a predefined order (alphabetically) and strip the others that have no relevance for the producer, but are consumer side configuration?

So then the following would be equivalent
{code}
mail://mymailserver.com?password=cheese&username=claus // this being the key
mail://mymailserver.com?username=claus&password=cheese
mail://mymailserver.com?fetchSize=10&password=cheese&username=claus
{code}
but different then:
{code}
mail://mymailserver.com?password=bar&username=hadrian // this being another key
{code}

Just a though...

> 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.


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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52704#action_52704 ] 

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

trunk: 791395.

Need to force endpoints using :// as scheme separator as some protocols require that the path starts with //

> 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
>          Components: camel-core
>    Affects Versions: 1.6.1, 2.0-M2
>            Reporter: Hadrian Zbarcea
>            Assignee: Claus Ibsen
>             Fix For: 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.


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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52658#action_52658 ] 

Claus Ibsen edited comment on CAMEL-1756 at 7/2/09 10:59 PM:
-------------------------------------------------------------

Hadrian even consumers have a life :)

1)
So if the mandatory parameters is only producer specific, then we end up with potentially picking a endpoint from the registry in which is not configured exactly as the uri provided by the end user.

Registry contains
{{mail://mymailserver.com?password=cheese&username=claus}}

And end user provides this url to lookup
{{mail://mymailserver.com?fetchSize=10&password=cheese&username=claus}}

If Camel then pickup the endpoint in the registry then the option {{fetchSize}} will be ignored and the end user gets an endpoint that does not match.
So we must match all parameters, no matter what.

This is a -1


2)
However what we could do as you said was to rearrange the order of the parameters so they will match:
{{mail://mymailserver.com?username=claus&password=cheese}}
{{mail://mymailserver.com?password=cheese&username=claus}}

That is a good idea and a +1

      was (Author: davsclaus):
    Hadrian even consumers have a life :)

1)
So if the mandatory parameters is only producer specific, then we end up with potentially picking a endpoint from the registry in which is not configured exactly as the uri provided by the end user.

Registry contains
{{mail://mymailserver.com?password=cheese&username=claus}}

And end user provides this url to lookup
{{mail://mymailserver.com?fetchSize=10&password=cheese&username=claus}}

If Camel then pickup the endpoint in the registry then the option {{fetchSize}} will be ignored and the end user gets an endpoint that does not match.
So we must match all parameters, no matter what.

This is a -1


2)
However what we could do as you said was to rearrange the order of the parameters so they will match:
{{mail://mymailserver.com?username=claus&password=cheese
mail://mymailserver.com?password=cheese&username=claus}}

That is a good idea and a +1
  
> 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.


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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52458#action_52458 ] 

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

I looked into this beforehand, especially the seda endpoint.

It was a bit confusing as the seda endpoint is kinda like an internal JMS queue, so the uri notations is kinda like a queue name.
So the queue name was the unique but the parameters didnt matter.

But in Camel land the endpoints differ, here is why

Lets imagine we have this endpoint already registered
- seda:foo

And you want to lookup this endpoint
- seda:foo?concurrentConsumers=5

As the code is now, the two endpoints do not match and you create a 2nd endpoint. They are also different as the first endpoint is *not* using concurrent consumers.
But the 2nd does.

So I do not think there is a nice and clean way of doing this. 

> 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.


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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-1756.
--------------------------------

    Resolution: Fixed

trunk: 791124.

Endpoint resolution is improved to detect similar endpoints

> 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
>          Components: camel-core
>    Affects Versions: 1.6.1, 2.0-M2
>            Reporter: Hadrian Zbarcea
>            Assignee: Claus Ibsen
>             Fix For: 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.


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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52459#action_52459 ] 

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

Maybe we should add some flag to an endpoint whether it supports *same endpoint* but with different parameters.

In the seda case it should not do this as its confusing so we could do
- seda:foo

And when you do a getEndpoint with
- seda:foo?concurrentConsumers=5

You will get an exception that seda:foo is already registered.




> 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.


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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52585#action_52585 ] 

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

@Hadrian

I think we should resolve this with the queue components: direct, vm and seda
By letting the component hold a list of known queues.

Then the consumer/producer can do a lookup on the component for the queue to use and then have their own parameters.

Then we can do the seda one that will not confuse end users.

Then they behave like JMS queues

> 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.


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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52658#action_52658 ] 

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

Hadrian even consumers have a life :)

1)
So if the mandatory parameters is only producer specific, then we end up with potentially picking a endpoint from the registry in which is not configured exactly as the uri provided by the end user.

Registry contains
{{mail://mymailserver.com?password=cheese&username=claus}}

And end user provides this url to lookup
{{mail://mymailserver.com?fetchSize=10&password=cheese&username=claus}}

If Camel then pickup the endpoint in the registry then the option {{fetchSize}} will be ignored and the end user gets an endpoint that does not match.
So we must match all parameters, no matter what.

This is a -1


2)
However what we could do as you said was to rearrange the order of the parameters so they will match:
{{mail://mymailserver.com?username=claus&password=cheese
mail://mymailserver.com?password=cheese&username=claus}}

That is a good idea and a +1

> 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.