You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Luca Burgazzoli (JIRA)" <ji...@apache.org> on 2017/05/30 07:02:04 UTC

[jira] [Comment Edited] (CAMEL-10320) Provide a LeaderPolicy to ease the implementation of master/slave route/context

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

Luca Burgazzoli edited comment on CAMEL-10320 at 5/30/17 7:01 AM:
------------------------------------------------------------------

[~dhirajsb] I've started working on CAMEL-11362 as there is a wider need than for route policies only for leader elections stuffs so for this JIRA it would be nice to have the new re-factored master and its pluggable strategy which can the leverage CAMEL-11362. 

I'll take care of the DSL too as it is required as part of the CAMEL-11362 and it has impact on the Service Call EIP configuration.


was (Author: lb):
[~dhirajsb] I've started working on CAMEL-11362 as there is a wider need than for route policies only for leader elections stuffs so for this JIRA it would be nice to have the new re-factored master and its pluggable strategy which can the leverage CAMEL-11362. 

I'll take care of the DSL too as it is required as part of the CAMEL-11362.

> Provide a LeaderPolicy to ease the implementation of master/slave route/context
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-10320
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10320
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Luca Burgazzoli
>            Assignee: Dhiraj Bokde
>             Fix For: 2.20.0
>
>
> I've been working on some master/slave RoutePolicy and I'm wondering
> if we can have a proper LeaderPolicy with a standardized
> implementation in Camel 3.0 so one has only to notify when a
> leadership is taken
> In addition it may be nice to have:
> - a support for Leader election from the CmelContext so the routes are
> started when the context become leader.
> - an option to warm-up routes or to keep them stopped while not leader
> Then we can also make it exposed in JMX so tooling are able to detect
> which are current master and slaves, and whatnot.
> Some possible DSL/EIP extensions:
> {code:java}
> from("...")
>     .routeId("myRoute")
>     .master() 
>         .group("my-group")
>         .consulConfiguration("http://consul-node:8500")
>         .end()
>     . to(...)
> {code}
> {code:java}
> camelContext.setDefaultClusteredRouteConfiguration(
>     ClusteredRouteConfiguration.builder()
>         .withAction(ClusteredRouteAction.SUSPEND)
>         .withHealtCheck(...)
>         .consulConfiguration("http://consul-node:8500")
>         .build()
> );
>   
> // lookup the cluster configuration from the registry   
> from("clustered:file:/data")
>     .routeId("data-files")
>     .to(...)
> // lookup the cluster configuration from the registry  
> from("master:file:/share")
>     .routeId("shared-files")
>     .master()
>         .configuration("...")
>         .end()
>     .to(...)
> {code}
> {code:xml}
> <camelContext .../>
>     <defaultMasterConfiguration/>
>         <consulConfiguration url="" userName="" password=""/>
>     <defaultMasterConfiguration/>
>     <masterConfiguration id="master-1"/>
>         <consulConfiguration url="" userName="" password=""/>
>     <masterConfiguration/>
>     <!-- 
>         this route should pick up the default configuration 
>     -->
>     <route id="data-files">
>         <from uri="master:file:/data"/>
>         <to uri="..."/>
>     <route>
>    <!-- 
>         this route should pick up the configuration named 
>         master-1 and the master prefix should be optional.
>     -->
>    <route id="shared-files">
>         <from uri="file:/shared"/>
>         <master configurationRef="master-1"/>
>         <to uri="..."/>
>     <route>
> </camelContext>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)