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

Camel 3.0.0 Failed to start route because of Multiple consumers for the same endpoint is not allowed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 3.0.0, 3.0.1, 3.1.0
    • 3.2.0
    • None
    • Unknown

    Description

      I am creating this issue as suggested by claus from Camel-Users group

      Hi I am having this clueless problem SAMPLE PROJECT IS ATTACHED IN ATTACHMENT SECTION 
      pom.xml:
      <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      </dependency>
      <dependency>
         <groupId>org.apache.camel.springboot</groupId>
          <artifactId>camel-spring-boot-starter</artifactId>
         <version>3.0.0</version>
      </dependency>
      <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-jetty</artifactId>
      <version>3.0.0</version>
      </dependency>

      REST XML : 
      <rests xmlns="http://camel.apache.org/schema/spring">
      <rest path="/api" description="Notification consumer with a REST endpoint">
      <post uri="/notification" description="enque" >
      <to uri="direct:test"/>
      </post>
      </rest>
      </rests>

      CAMEL ROUTE:
      <route id="route-test" autoStartup="true">
      <from uri="direct:test" />
         <unmarshal><custom ref="notification"/></unmarshal>
         <to uri="bean:processor?method=test"/>
         <marshal><custom ref="notification"/></marshal>
         <setHeader name="CamelHttpResponseCode">
      <constant>200</constant>
      </setHeader>
       </route>

      EXCEPTION:
      2020-03-12 13:17:12,623 spring-ec2 INFO [main] SpringCamelContext: Route:
      route1 started and consuming from: jetty:
      http://0.0.0.0:8081/api/notification?httpMethodRestrict=POST
      2020-03-12 13:17:12,625 spring-ec2 INFO [main] SpringCamelContext: Route:
      route-test started and consuming from: direct://test
      2020-03-12 13:17:12,627 spring-ec2 INFO [main] SpringCamelContext: Apache
      Camel 3.0.0 (CamelContext: charge-process-fonix-context) is shutting down
      2020-03-12 13:17:12,628 spring-ec2 INFO [main] DefaultShutdownStrategy:
      Starting to graceful shutdown 2 routes (timeout 300 seconds)
      2020-03-12 13:17:12,634 spring-ec2 INFO [Camel
      (charge-process-fonix-context) thread #1 - ShutdownTask]
      DefaultShutdownStrategy: Route: route-test shutdown complete, was consuming
      from: direct://test
      2020-03-12 13:17:12,639 spring-ec2 INFO [Camel
      (charge-process-fonix-context) thread #1 - ShutdownTask] AbstractConnector:
      Stopped ServerConnector@26275b46

      {HTTP/1.1,[http/1.1]} {0.0.0.0:8081}

      2020-03-12 13:17:12,642 spring-ec2 INFO [Camel
      (charge-process-fonix-context) thread #1 - ShutdownTask] ContextHandler:
      Stopped o.e.j.s.ServletContextHandler@274fdea6{/,null,UNAVAILABLE}
      2020-03-12 13:17:12,644 spring-ec2 INFO [Camel
      (charge-process-fonix-context) thread #1 - ShutdownTask]
      DefaultShutdownStrategy: Route: route1 shutdown complete, was consuming
      from: jetty:http://0.0.0.0:8081/api/notification?httpMethodRestrict=POST
      2020-03-12 13:17:12,644 spring-ec2 INFO [main] DefaultShutdownStrategy:
      Graceful shutdown of 2 routes completed in 0 seconds
      2020-03-12 13:17:12,656 spring-ec2 INFO [main] SpringCamelContext: Apache
      Camel 3.0.0 (CamelContext: charge-process-fonix-context) uptime 0.484
      seconds
      2020-03-12 13:17:12,656 spring-ec2 INFO [main] SpringCamelContext: Apache
      Camel 3.0.0 (CamelContext: charge-process-fonix-context) is shutdown in
      0.029 seconds
      2020-03-12 13:17:12,658 spring-ec2 ERROR [main] SpringCamelContext: Error
      starting CamelContext (charge-process-fonix-context) due to exception
      thrown: Failed to start route route2 because of Multiple consumers for the
      same endpoint is not allowed: jetty:
      http://0.0.0.0:8081/api/notification?httpMethodRestrict=POST

      org.apache.camel.FailedToStartRouteException: Failed to start route route2
      because of Multiple consumers for the same endpoint is not allowed: jetty:
      http://0.0.0.0:8081/api/notification?httpMethodRestrict=POST

      Note: Problem does not happen using below version 

      <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-spring-boot-starter</artifactId>
      <version>2.25.0</version>
      </dependency>

      But Any version from 3.0.0 from throws above exception

      <dependency>
      <groupId>org.apache.camel.springboot</groupId>
      <artifactId>camel-spring-boot-starter</artifactId>
      <version>3.0.0</version>
      </dependency>

       

      Attachments

        1. image-2020-03-13-10-30-33-659.png
          81 kB
          Ranabroto Ghosh
        2. image-2020-03-13-10-32-23-060.png
          55 kB
          Ranabroto Ghosh
        3. image-2020-03-13-10-33-04-404.png
          66 kB
          Ranabroto Ghosh
        4. image-2020-03-13-10-33-54-335.png
          92 kB
          Ranabroto Ghosh
        5. image-2020-03-13-10-34-28-450.png
          66 kB
          Ranabroto Ghosh
        6. image-2020-03-13-10-36-35-626.png
          403 kB
          Ranabroto Ghosh
        7. spring-camel3-ec2.zip
          64 kB
          Ranabroto Ghosh

        Activity

          People

            davsclaus Claus Ibsen
            Ranabroto Ranabroto Ghosh
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: