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

Luca Burgazzoli edited comment on CAMEL-16221 at 2/17/21, 8:58 AM:
-------------------------------------------------------------------

[~gnodet] maybe we do not need to reserve a specific property for the path as 
example:

camel-http has http:httpUri as syntax
camel-infinispan has infinispan:cacheName

So in fact, we may only need to use such properties (and check that components 
are doing the right things)

[~davsclaus] we could think to have the EndpointUriFactory to be able to 
marshal and unmarshal endpoint uris, like:

{code:java}
String uri = EndpointUriFactory.buildUri(
    "http", Map.of("httpUri", "/a/b/c", "foo", "bar"));
EndpointDefinition definition = EndpointUriFactory.parseUri(
    "http://a/b/c?foo=bar";);
{code}

Maybe EndpointDefinition.toString() should then compute the uri


was (Author: lb):
[~gnodet] maybe we do not need to reserve a specific property for the path as 
example:

camel-http has http:httpUri as syntax
camel-infinispan has infinispan:cacheName

So in fact, we may only need to use such properties (and check that components 
are doing the right things)

[~davsclaus] we could think to have the EndpointUriFactory to be able to 
marshal and unmarshal endpoint uris, like:

{code:java}
String uri = EndpointUriFactory.buildUri("http", Map.of("httpUri", "/a/b/c", 
"foo", "bar"));
EndpointDefinition definition = 
EndpointUriFactory.parseUri("http://a/b/c?foo=bar";);
{code}

Maybe EndpointDefinition.toString() should then compute the uri

> Rethink endpoints URI usage for camel internals
> -----------------------------------------------
>
>                 Key: CAMEL-16221
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16221
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Luca Burgazzoli
>            Priority: Minor
>             Fix For: 3.x
>
>
> As today URIs are the primary mechanism Camel uses internally to describe 
> endpoints but I think it is time to re-consider the dependency on URIs for 
> camel internals and leave the URIs as an external representation of endpoints
> As example:
> - the Endpoint DSL is required to generate the related endpoint URI to 
> leverage Camel's APIs but to create an endpoint, the schema and a map of 
> options, would be more than enough. 
> - components that wrap other components, such as kamelets, master & co may 
> need to re-create URIs to create instances of the delegated endpoints which 
> is cumbersome as there's lot of options to take into account (RAW, 
> url-encoding, placeholders)
> - the YAML DSL and camel-kafka-connectors are using and Endpoint DSL alike 
> syntax where a user can define endpoints by scheme + option pairs without the 
> need of writing URIs.



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

Reply via email to