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

camel-rabbitmq: exchangeName in URI must be optional, i.e. default "" exchange

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.14.1
    • 2.14.3, 2.15.3, 2.16.0
    • camel-rabbitmq
    • None
    • Unknown

    Description

      Leaving out the exchangeName i.e. rabbitmq://localhost/ throws exception below.

      However RabbitMQ has the default exchange "" so it's not required to specify amq.direct explicitly., and this makes it impossible to send to that exchange (which is different than amq.direct).

      Should have been fixed by CAMEL-7031 (2.12.3) but still happens in 2.14.1 (probably regression)

      Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camelContext' defined in class path resource [id/ac/itb/lumen/persistence/LumenCamelConfiguration.class]: Invocation of init method failed; nested exception is org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[rabbitmq://localhost/?connectionFactory=#amqpConnFactory] <<< in route: Route(route1)[[From[rabbitmq://localhost/amq.topic?connectio... because of Failed to resolve endpoint: rabbitmq://localhost/?connectionFactory=%23amqpConnFactory due to: No URI path as the exchangeName for the RabbitMQEndpoint, the URI is rabbitmq://localhost/?connectionFactory=%23amqpConnFactory
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
      	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
      	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:961)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:950)
      	at org.springframework.boot.SpringApplication$run.call(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
      	at id.ac.itb.lumen.persistence.LumenPersistenceApplication.main(LumenPersistenceApplication.groovy:38)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:483)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
      Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[rabbitmq://localhost/?connectionFactory=#amqpConnFactory] <<< in route: Route(route1)[[From[rabbitmq://localhost/amq.topic?connectio... because of Failed to resolve endpoint: rabbitmq://localhost/?connectionFactory=%23amqpConnFactory due to: No URI path as the exchangeName for the RabbitMQEndpoint, the URI is rabbitmq://localhost/?connectionFactory=%23amqpConnFactory
      	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:945)
      	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:187)
      	at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:805)
      	at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:2174)
      	at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1906)
      	at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1767)
      	at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
      	at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1735)
      	at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:254)
      	at org.apache.camel.spring.SpringCamelContext.afterPropertiesSet(SpringCamelContext.java:106)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562)
      	... 23 more
      Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: rabbitmq://localhost/?connectionFactory=%23amqpConnFactory due to: No URI path as the exchangeName for the RabbitMQEndpoint, the URI is rabbitmq://localhost/?connectionFactory=%23amqpConnFactory
      	at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:547)
      	at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:72)
      	at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:202)
      	at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)
      	at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)
      	at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)
      	at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)
      	at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)
      	at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:213)
      	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:942)
      	... 34 more
      Caused by: java.lang.IllegalArgumentException: No URI path as the exchangeName for the RabbitMQEndpoint, the URI is rabbitmq://localhost/?connectionFactory=%23amqpConnFactory
      	at org.apache.camel.component.rabbitmq.RabbitMQComponent.createEndpoint(RabbitMQComponent.java:50)
      	at org.apache.camel.component.rabbitmq.RabbitMQComponent.createEndpoint(RabbitMQComponent.java:31)
      	at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:122)
      	at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:527)
      	... 43 more
      

      Attachments

        Issue Links

          Activity

            People

              njiang Willem Jiang
              ceefour Hendy Irawan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: