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

Luca Burgazzoli commented on CAMEL-10793:
-----------------------------------------

I think it could work too. 

The rationale behind the DSL is that I may not want to expose the full URI but 
only the options that are needed to contact the service, i.e. for http bases 
services we don't need to expose the implementation (jetty, undertow) but only 
the protocol (http/s)  so the service component would work nice with 
endpoints/consumenrs that implements an interface like DiscoverableService

> camel cloud: expose routes as a service
> ---------------------------------------
>
>                 Key: CAMEL-10793
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10793
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Luca Burgazzoli
>            Assignee: Luca Burgazzoli
>            Priority: Major
>              Labels: cloud
>             Fix For: 2.22.0
>
>
> As today we have a ServiceCall EIP that makes it easy to call external 
> services in a cloud environment leveraging external service registry such as 
> kubernetes, consul, etcd, spring-cloud & co so It could make sense to add a 
> way for a route to register itself in such registries and be available as a 
> service for other to consume.
> Something like:
> {code:java}
>     // programmatic config
>     from("jetty:http://0.0.0.0:8001/service1";)
>         .serviceRegistry()
>             .name("service-1")
>             .host("....")
>             .port(8001)
>             .meta("camel.protocol", "http")
>             .meta("camel.component", "jetty")
>             .meta("camel.context.path", "/service1")
>             .end()
>         .to("direct:service-1")
>     // Inherit from a global config and eventually override it
>     from("jetty:http://0.0.0.0:8002/service2";)
>       .serviceRegistry("service-2")
>           .configRef("service-registry-conf")
>           .port(8002)
>       .to("direct:service-2")
>     // Smart auto configuration
>     //   i.e. if the endpoint implements DiscoverableService
>     from("jetty:http://0.0.0.0:8003/service3";)
>       .serviceRegistry("service-3")
>       .to("direct:service-3")
> {code}
> Beside making camel play better in cloud environment,  you can use the 
> service call to connect camel based micro services with minimal configuration 
> as the registration may provide some additional meta data that the service 
> call can use for auto-configuration (of course not all the registries can do 
> it).
> The future Health  API/Service may then also be configured to remove or 
> invalidate the service if the route is reported as not healthy.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to