camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hadrian Zbarcea (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-1756) getEndpoint() should match for singleton endpoints even if url does not contain params
Date Thu, 25 Jun 2009 14:55:36 GMT

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


Mime
View raw message