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

DirectConsumer not available any more

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Information Provided
    • Affects Version/s: 3.3.0
    • Fix Version/s: 3.4.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Code like this used to work with 3.1.0, but fails with 3.3.0

              CamelContext camelctx = new DefaultCamelContext(false);
              camelctx.setLoadTypeConverters(true);
              camelctx.init();
              
              camelctx.addRoutes(new RouteBuilder() {
                  @Override
                  public void configure() throws Exception {
                      from("direct:start").convertBodyTo(Map.class);
                  }
              });
      
              camelctx.start();
              try {
                  ProducerTemplate producer = camelctx.createProducerTemplate();
                  Map<?, ?> result = producer.requestBody("direct:start", new Customer("John", "Doe"), Map.class);
                  Assert.assertEquals("{firstName=John, lastName=Doe}", result.toString());
              } finally {
                  camelctx.close();
              }
      
      Caused by: org.apache.camel.component.direct.DirectConsumerNotAvailableException: No consumers available on endpoint: direct://start. Exchange[]
      	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:59)
      	at org.apache.camel.processor.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:212)
      	at org.apache.camel.processor.SharedCamelInternalProcessor$1.process(SharedCamelInternalProcessor.java:110)
      	at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83)
      	at org.apache.camel.processor.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:107)
      	at org.apache.camel.impl.engine.DefaultProducerCache.send(DefaultProducerCache.java:185)
      	at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:176)
      	at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:172)
      	at org.apache.camel.impl.engine.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:390)
      	... 150 more
      

      it seems to have to do with the use of ...

              camelctx.setLoadTypeConverters(true);
              camelctx.init();
      

      Is this an intentional change that requires code migration?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tdiesler Thomas Diesler
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: