camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-1574) Registering Endpoint by URI - Add strategy to Component to allow components to construct key
Date Mon, 18 May 2009 06:04:50 GMT

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

Claus Ibsen commented on CAMEL-1574:
------------------------------------

This one is not easy to remedy a solution when endpoint is defined in multiple locations in
a route, such as above.

The first one, will create the {{seda:foo}} endpoint with default settings.
Then the 2nd, will try to lookup the {{seda:foo?concurrentConsumers=2}} endpoint based on
the URI but cannot find it and creates a new endpoint.

The problem is that if we do the logical key thing then {{seda:foo}} is created with default
settings and then when we do the 2nd lookup it will find this endpoint but not use the {{concurrentConsumers=2}}
option.

The only solution is to define shared endpoint once and reuse the alias in your route, like
below:
{code}
Endpoint foo = endpoint("seda:foo?concurrentConsumers=2");

from(x)....to(foo);
...
from(foo).to(z);
{code}

> Registering Endpoint by URI - Add strategy to Component to allow components to construct
key
> --------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1574
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1574
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>    Affects Versions: 1.6.0, 2.0-M1
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>
> URIs is the preferred means to identify and lookup endpoints. The general rule of thumb
is that you must use the exact same URI every time to lookup the same endpoint.
> That can confuse for components that has a logical key that represents the same endpoint.
For example
> - {{seda:foo}}
> - {{seda:foo?concurrentConsumers=2}}
> In peoples mind its the same endpoint, its the seda *foo* queue. But in Camel its 2 different
endpoints. So you cannon link them together. So this wont work:
> {code}
> from(x)....to("seda:foo");
> ...
> from("seda:foo?concurrentConsumers=2").to(z);
> {code}
> So if we add some strategy to component so it can construct a the logical key for its
endpoint.
> For instance the SedaComponent would be able to return the key: {{seda:foo}} for whether
or without the concurrentConsumer option. Its the same logical endpoint.
> The same will apply for JMS component and others.

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