Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-11023

Hystrix Starter : add an option to configure additional configuration via spring-boot properties

    XMLWordPrintableJSON

Details

    • Unknown

    Description

      In addition to configre the default hystrix configuration it would be nice to have a way to configre additional configurations in spring-boot appliction.properties, like:

      // default
      camel.hystrix.group-key=global-group
      
      // named conf conf-1
      camel.hystrix.configurations.conf-1.group-key=conf-1-group
      
      // named conf conf-1
      camel.hystrix.configurations.conf-2.group-key=conf-2-group
      

      Then the configrations can be referenced in camel routes:

      public class HystrixMultiConfiguration {
          @Bean
          public RouteBuilder routeBuilder() {
              return new RouteBuilder() {
                  @Override
                  public void configure() throws Exception {
                      from("direct:start-1")
                          .routeId("hystrix-route-1")
                          .hystrix()
                              .hystrixConfiguration("conf-1")
                              .to("direct:foo")
                          .onFallback()
                              .transform().constant("Fallback message")
                          .end();
                      from("direct:start-2")
                          .routeId("hystrix-route-2")
                          .hystrix()
                              .hystrixConfiguration("conf-2")
                              .to("direct:foo")
                          .onFallback()
                              .transform().constant("Fallback message")
                          .end();
      
                      from("direct:foo")
                          .transform().body(b -> "Bye World");
                  }
              };
          }
      }
      

      This would also have to create additional "templates" one can inherit and further customize in routes.

      Attachments

        Activity

          People

            lb Luca Burgazzoli
            lb Luca Burgazzoli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: