You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Stepan Shcherbakov (Jira)" <ji...@apache.org> on 2021/03/11 10:45:00 UTC

[jira] [Created] (CAMEL-16338) Return parametrized Endpoint class from Component#createEndpoint

Stepan Shcherbakov created CAMEL-16338:
------------------------------------------

             Summary: Return parametrized Endpoint class from Component#createEndpoint
                 Key: CAMEL-16338
                 URL: https://issues.apache.org/jira/browse/CAMEL-16338
             Project: Camel
          Issue Type: Wish
          Components: came-core
            Reporter: Stepan Shcherbakov


There is Component interface in camel with methods:

 
{code:java}
Endpoint createEndpoint(String uri) throws Exception;{code}
and
{code:java}
Endpoint createEndpoint(String uri, Map<String, Object> parameters) throws Exception;
{code}
This signature is OK, but, when i write my own components, its uncomfortable.
For example, i work with RabbitMqComponent and i would like to configure RabbitMqEndpoint.
When i call RabbitMqComponent#createEndpoint i have to cast Endpoint to RabbitMqEndpoint.

 

May be Component interface should be like that:
{code:java}
public interface Component<T extends Endpoint> extends CamelContextAware, Service {
    T createEndpoint(String uri) throws Exception;


    T createEndpoint(String uri, Map<String, Object> parameters) throws Exception;
}{code}
or it would lead to backward compability problems?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)