osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Camel 2.22.1 and Rabbitmq getting a error


Hi,

I am trying to connect Camel to RabbitMq  but I am getting the error
below. Does any body have any idea why this configuration is not working?
I have attached the PM and Route XML.


Thank you,
Ali

2018-11-09 22:19:30.764  INFO 30863 --- [           main]
o.a.c.c.rabbitmq.RabbitMQComponent       : Auto-detected single instance:
customConnectionFactory of type ConnectionFactory in Registry to be used
as ConnectionFactory when creating endpoint:
rabbitmq://connectionFactory=%23customConnectionFactory&queue=network_status&vhost=rbo&exchangeType=queue&autoDelete=false&prefetchEnabled=true&prefetchCount=100&threadPoolSize=100&channelPoolMaxSize=100
2018-11-09 22:19:30.822  INFO 30863 --- [           main]
o.a.camel.spring.SpringCamelContext      : StreamCaching is not in use. If
using streams then its recommended to enable stream caching. See more
details at http://camel.apache.org/stream-caching.html
2018-11-09 22:19:35.942  WARN 30863 --- [0:0:0:0:1:15672]
c.r.c.impl.ForgivingExceptionHandler     : An unexpected connection driver
error occured (Exception message: Socket closed)
2018-11-09 22:19:40.938  WARN 30863 --- [127.0.0.1:15672]
c.r.c.impl.ForgivingExceptionHandler     : An unexpected connection driver
error occured (Exception message: Socket closed)
2018-11-09 22:19:40.944  WARN 30863 --- [           main]
o.a.c.component.rabbitmq.RabbitConsumer  : Unable to open channel for
RabbitMQConsumer. Continuing and will try again

java.util.concurrent.TimeoutException: null
	at com.rabbitmq.utility.BlockingCell.get(BlockingCell.java:77)
~[amqp-client-5.4.3.jar:5.4.3]
	at
com.rabbitmq.utility.BlockingCell.uninterruptibleGet(BlockingCell.java:120)
~[amqp-client-5.4.3.jar:5.4.3]
	at
com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
~[amqp-client-5.4.3.jar:5.4.3]
	at
com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:494)
~[amqp-client-5.4.3.jar:5.4.3]
	at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:315)
~[amqp-client-5.4.3.jar:5.4.3]
	at
com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:64)
~[amqp-client-5.4.3.jar:5.4.3]
	at
com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:156)
~[amqp-client-5.4.3.jar:5.4.3]
	at
com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1095)
~[amqp-client-5.4.3.jar:5.4.3]
	at
com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1054)
~[amqp-client-5.4.3.jar:5.4.3]
	at
com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1012)
~[amqp-client-5.4.3.jar:5.4.3]
	at
com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1201)
~[amqp-client-5.4.3.jar:5.4.3]
	at
org.apache.camel.component.rabbitmq.RabbitMQEndpoint.connect(RabbitMQEndpoint.java:230)
~[camel-rabbitmq-2.22.1.jar:2.22.1]
	at
org.apache.camel.component.rabbitmq.RabbitMQConsumer.openConnection(RabbitMQConsumer.java:64)
[camel-rabbitmq-2.22.1.jar:2.22.1]
	at
org.apache.camel.component.rabbitmq.RabbitMQConsumer.getConnection(RabbitMQConsumer.java:75)
[camel-rabbitmq-2.22.1.jar:2.22.1]
	at
org.apache.camel.component.rabbitmq.RabbitConsumer.<init>(RabbitConsumer.java:55)
~[camel-rabbitmq-2.22.1.jar:2.22.1]
	at
org.apache.camel.component.rabbitmq.RabbitMQConsumer.createConsumer(RabbitMQConsumer.java:120)
[camel-rabbitmq-2.22.1.jar:2.22.1]
	at
org.apache.camel.component.rabbitmq.RabbitMQConsumer.createConsumers(RabbitMQConsumer.java:96)
[camel-rabbitmq-2.22.1.jar:2.22.1]
	at
org.apache.camel.component.rabbitmq.RabbitMQConsumer.doStart(RabbitMQConsumer.java:172)
[camel-rabbitmq-2.22.1.jar:2.22.1]
	at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
[camel-core-2.22.1.jar:2.22.1]
	at
org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:3705)
[camel-core-2.22.1.jar:2.22.1]
	at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRouteConsumers(DefaultCamelContext.java:4023)
[camel-core-2.22.1.jar:2.22.1]
	at
org.apache.camel.impl.DefaultCamelContext.doStartRouteConsumers(DefaultCamelContext.java:3958)
[camel-core-2.22.1.jar:2.22.1]
	at
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3878)
[camel-core-2.22.1.jar:2.22.1]
	at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3642)
[camel-core-2.22.1.jar:2.22.1]
	at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3494)
[camel-core-2.22.1.jar:2.22.1]
	at
org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:209)
[camel-core-2.22.1.jar:2.22.1]
	at
org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3253)
[camel-core-2.22.1.jar:2.22.1]
	at
org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3249)
[camel-core-2.22.1.jar:2.22.1]
	at
org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3272)
[camel-core-2.22.1.jar:2.22.1]
	at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3249)
[camel-core-2.22.1.jar:2.22.1]
	at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
[camel-core-2.22.1.jar:2.22.1]
	at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3165)
[camel-core-2.22.1.jar:2.22.1]
	at
org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:133)
[camel-spring-2.22.1.jar:2.22.1]
	at
org.apache.camel.spring.CamelContextFactoryBean.start(CamelContextFactoryBean.java:369)
[camel-spring-2.22.1.jar:2.22.1]
	at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:416)
[camel-spring-2.22.1.jar:2.22.1]
	at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:94)
[camel-spring-2.22.1.jar:2.22.1]
	at
org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at
org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:398)
[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:355)
[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:882)
[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:161)
[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
	at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
	at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
	at
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
	at
org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
	at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
	at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
	at
viasat.camel.RmqToS3CamelApplication.main(RmqToS3CamelApplication.java:21)
[classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[na:1.8.0_151]
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[na:1.8.0_151]
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.8.0_151]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
	at
org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:558)
[spring-boot-maven-plugin-2.1.0.RELEASE.jar:2.1.0.RELEASE]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>

  <modelVersion>4.0.0</modelVersion>

  <groupId>com.viasat.camel</groupId>
  <artifactId>RMQtoS3</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>Viasat :: RMQ-TO-S3</name>
  <description>Move the data from SMS queues to S3 </description>

  <properties>
    <category>RMQ-TO-S3</category>
     <title>RMQ-TO-S3</title>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <spring.boot-version>2.1.0.RELEASE</spring.boot-version>
    <camel.version>2.22.1</camel.version>
  </properties>

  <dependencyManagement>
    <dependencies>

      <!-- Spring Boot BOM -->
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring.boot-version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <!-- Camel BOM -->
      <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring-boot-dependencies</artifactId>
        <version>${camel.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>

    <!-- Spring Boot -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-tomcat</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-undertow</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-actuator</artifactId>
    </dependency>

    <!-- Camel -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-spring-boot-starter</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-stream-starter</artifactId>
    </dependency>

    <!--  amq -->
    <dependency>
       <groupId>org.apache.camel</groupId>
       <artifactId>camel-stream</artifactId>
       <version>${camel.version}</version>
    </dependency>
    <dependency>
       <groupId>org.apache.camel</groupId>
       <artifactId>camel-jms</artifactId>
       <version>${camel.version}</version>
    </dependency> 
    <dependency>
       <groupId>org.apache.camel</groupId>
       <artifactId>camel-rabbitmq</artifactId>
       <version>${camel.version}</version>
    </dependency> 
  
    <!-- test -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-test-spring</artifactId>
      <scope>test</scope>
    </dependency>

    <!--logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.12</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.7.12</version>
    </dependency>

  </dependencies>
 
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <!-- to validate Camel endpoints: mvn camel:validate -->
      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-maven-plugin</artifactId>
        <version>${project.version}</version>
        <configuration>
          <failOnError>false</failOnError>
          <includeTest>true</includeTest>
          <includeXml>true</includeXml>
          <ignoreLenientProperties>false</ignoreLenientProperties>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>resources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>    
  
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>${spring.boot-version}</version>
        <executions>
          <execution>
            <goals>
              <goal>repackage</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-maven-plugin</artifactId>
        <version>${project.version}</version>
        <!-- allows to fail if not all routes are fully covered during testing -->
<!--
        <configuration>
          <failOnError>true</failOnError>
        </configuration>
-->
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>jdk9+-build</id>
      <activation>
        <jdk>[9,)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <argLine>--add-modules java.xml.bind --add-opens java.base/java.lang=ALL-UNNAMED</argLine>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:rabbit="http://www.springframework.org/schema/rabbit";
       xsi:schemaLocation="
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
         http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd";>

  <bean id="customConnectionFactory" class="com.rabbitmq.client.ConnectionFactory">
    <property name="host" value="localhost"/>
    <property name="port" value="15672"/>
    <property name="username" value="guest"/>
    <property name="password" value="guest"/>
  </bean>     

  <camelContext id="RMQ2S3" xmlns="http://camel.apache.org/schema/spring";>
    <route id="hello">
      <from uri="rabbitmq:connectionFactory=#customConnectionFactory&amp;queue=network_status&amp;vhost=rbo&amp;exchangeType=queue&amp;autoDelete=false&amp;prefetchEnabled=true&amp;prefetchCount=100&amp;threadPoolSize=100&amp;channelPoolMaxSize=100"/>
      <to uri="stream:out"/>
    </route>
  </camelContext>

</beans>