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

Fraction does not retain state from Main to Runtime

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2016.8
    • Component/s: examples
    • Labels:
      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  thomas.diesler Thomas Diesler
                  Reporter:
                  thomas.diesler Thomas Diesler
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: