[
https://issues.apache.org/jira/browse/CAMEL-23422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Federico Mariani updated CAMEL-23422:
-------------------------------------
Fix Version/s: 4.18.3
> camel-spring-rabbitmq - Exported camel-jbang project with RabbitMQ consumer
> not consuming messages anymore on runtime main
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-23422
> URL: https://issues.apache.org/jira/browse/CAMEL-23422
> Project: Camel
> Issue Type: Bug
> Components: camel-spring-rabbitmq
> Affects Versions: 4.18.1
> Reporter: Michael Weiss
> Assignee: Federico Mariani
> Priority: Minor
> Fix For: 4.18.3
>
>
> In 4.18.1 Spring RabbitMQ consumer does not consume messages from RabbitMQ
> anymore.
> It works in camel-jbang 4.18.1 but not in an exported camel-main maven
> project.
> Maybe this is related to how maven project is built. There is a difference in
> pom.xml and CamelApplication.java between 4.18.0 and 4.18.1, see diff below:
> {noformat}
> diff --git a/off-rabbit-demo/camel-export/pom.xml
> b/off-rabbit-demo/camel-export/pom.xml
> index 7d8a1d8..0dce4f7 100644
> --- a/off-rabbit-demo/camel-export/pom.xml
> +++ b/off-rabbit-demo/camel-export/pom.xml
> @@ -9,7 +9,7 @@
>
> <properties>
> <java.version>21</java.version>
> -
> <project.build.outputTimestamp>2026-03-17T08:51:37Z</project.build.outputTimestamp>
> +
> <project.build.outputTimestamp>2026-05-05T14:09:48Z</project.build.outputTimestamp>
>
>
> </properties>
> @@ -20,7 +20,7 @@
> <dependency>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-bom</artifactId>
> - <version>4.18.0</version>
> + <version>4.18.1</version>
> <type>pom</type>
> <scope>import</scope>
> </dependency>
> @@ -94,7 +94,7 @@
> <plugin>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-maven-plugin</artifactId>
> - <version>4.18.0</version>
> + <version>4.18.1</version>
> <configuration>
>
> <mainClass>org.example.project.route.CamelApplication</mainClass>
> </configuration>
> @@ -108,30 +108,19 @@
> </plugin>
> <!-- package as runner jar -->
> <plugin>
> - <groupId>org.apache.maven.plugins</groupId>
> - <artifactId>maven-assembly-plugin</artifactId>
> - <version>3.7.1</version>
> - <configuration>
> - <descriptors>
> -
> <descriptor>src/main/resources/assembly/runner.xml</descriptor>
> - </descriptors>
> - <archive>
> - <manifest>
> -
> <mainClass>org.example.project.route.CamelApplication</mainClass>
> - </manifest>
> - <manifestEntries>
> - <Multi-Release>true</Multi-Release>
> - </manifestEntries>
> - </archive>
> - <appendAssemblyId>false</appendAssemblyId>
> - </configuration>
> + <groupId>org.apache.camel</groupId>
> + <artifactId>camel-repackager-maven-plugin</artifactId>
> + <version>4.18.1</version>
> <executions>
> <execution>
> - <id>make-assembly</id>
> + <id>repackage-executable</id>
> <phase>package</phase>
> <goals>
> - <goal>single</goal>
> + <goal>repackage</goal>
> </goals>
> + <configuration>
> +
> <mainClass>org.example.project.route.CamelApplication</mainClass>
> + </configuration>
> </execution>
> </executions>
> </plugin>
> diff --git
> a/off-rabbit-demo/camel-export/src/main/java/org/example/project/route/CamelApplication.java
>
> b/off-rabbit-demo/camel-export/src/main/java/org/example/project/route/CamelApplication.java
> index 15f595f..aa19d07 100644
> ---
> a/off-rabbit-demo/camel-export/src/main/java/org/example/project/route/CamelApplication.java
> +++
> b/off-rabbit-demo/camel-export/src/main/java/org/example/project/route/CamelApplication.java
> @@ -1,6 +1,6 @@
> package org.example.project.route;
>
> -import org.apache.camel.main.Main;
> +import org.apache.camel.main.fatjar.Main;
>
> public class CamelApplication {
>
> {noformat}
> Tested with this example yaml dsl route:
> {noformat}
> - route: id: route-2714 from: uri: spring-rabbitmq
> parameters: autoDeclare: true deadLetterExchange:
> demo.deadletter deadLetterQueue: demo.queue.deadletter
> deadLetterRoutingKey: queue exchangeName: demo queues:
> demo.queue routingKey: queue steps: - throttle:
> id: throttle-3547 constant: expression: "1"
> timePeriodMillis: "5000" - log: message: ${body}
> - beans: - name: connectionFactory properties: host: rabbitmq
> password: "{{secret:context/rabbit.password}}" port: "5672"
> username: rabbituser type:
> "#class:org.springframework.amqp.rabbit.connection.CachingConnectionFacto\
> ry"{noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)