zhfeng commented on code in PR #165:
URL: 
https://github.com/apache/camel-quarkus-examples/pull/165#discussion_r1354481430


##########
message-bridge/src/main/resources/application.properties:
##########
@@ -0,0 +1,34 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+ibm.mq.host=localhost
+ibm.mq.port=1414
+ibm.mq.channel=DEV.APP.SVRCONN
+ibm.mq.queueManagerName=QM1
+ibm.mq.user=app
+ibm.mq.password=passw0rd
+ibm.mq.queue=DEV.QUEUE.1
+
+quarkus.artemis.amqConnectionFactory.url=tcp://localhost:61616
+quarkus.artemis.amqConnectionFactory.username=admin
+quarkus.artemis.amqConnectionFactory.password=admin
+amq.queue=in
+
+quarkus.camel.servlet.url-patterns=/*
+
+quarkus.pooled-jms.transaction=xa
+quarkus.pooled-jms.pooling.enabled=true
+quarkus.pooled-jms.max-connections=8

Review Comment:
   I'd like to add `quarkus.transaction-manager.enable-recovery=true` and it 
could be helpful to test the crash crash secenario.



##########
message-bridge/eclipse-formatter-config.xml:
##########


Review Comment:
   Why we need this file? I think it is related to Eclipse IDE?



##########
message-bridge/src/main/java/org/acme/message/bridge/MessageBridgeRoute.java:
##########
@@ -0,0 +1,46 @@
+package org.acme.message.bridge;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import org.apache.camel.builder.RouteBuilder;
+
+@ApplicationScoped
+public class MessageBridgeRoute extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+        restConfiguration().component("servlet");
+        rest()
+                .post("/message")
+                .id("rest")
+                .to("direct:publish");
+
+        from("direct:publish")
+                .id("ibmmq")
+                .transacted()
+                .log("Sending message to IBMMQ: ${body}")
+                .to("ibmmq:queue:{{ibm.mq.queue}}?disableReplyTo=true");
+
+        from("ibmmq:queue:{{ibm.mq.queue}}")
+                .id("ibmmq-amq")
+                .transacted()
+                .choice()
+                .when(simple("${header.JMSRedelivered}"))
+                .log("Redelivering message after rollback to ActiveMQ: 
${body}")
+                .otherwise()
+                .log("Sending message from IBMMQ to ActiveMQ: ${body}")
+                .end()
+                .to("amq:queue:{{amq.queue}}")
+                .process(ex -> {
+                    if 
(ex.getIn().getBody(String.class).toLowerCase().contains("rollback")) {
+                        if (!ex.getIn().getHeader("JMSRedelivered", 
Boolean.class)) {

Review Comment:
   Why we check `JMSRedelivered` here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to