Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-546

Fraction does not retain state from Main to Runtime

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Done
    • None
    • 2016.8
    • examples
    • None

    Description

      An explicit route definition in main like this

          public static void main(String... args) throws Exception {
              
              new Container()
                  .fraction(new CamelCoreFraction().addRouteBuilder("rest-context", new RouteBuilder() {
                      @Override
                      public void configure() throws Exception {
                          restConfiguration().component("undertow")
                          .contextPath("rest")
                          .host("localhost")
                          .port(8080)
                          .apiContextPath("/api-doc")
                          .apiProperty("api.title", "User API").apiProperty("api.version", "1.2.3")
                          .apiProperty("cors", "true");
                      
                          rest("/hello")
                          .get("/{name}").description("A user object").outType(User.class).to("direct:hello")
                          .produces(MediaType.APPLICATION_JSON)
                          .consumes(MediaType.APPLICATION_JSON);
                      
                          from("direct:hello").transform(simple("Hello ${header.name}"));
                      }
                   }))
                  .start(true).deploy();
          }
      

      works on *-swarm.jar, but not with

      mvn wildfly-swarm:run
      

      in which case the CamelCoreConfiguration always creates a new instance of CamelCoreFraction without the user defined state.

      Attachments

        Issue Links

          Activity

            People

              tdiesler@redhat.com Thomas Diesler
              tdiesler@redhat.com Thomas Diesler
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: