This is an automated email from the ASF dual-hosted git repository.

zhfeng pushed a commit to branch 3.2.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus-examples.git


The following commit(s) were added to refs/heads/3.2.x by this push:
     new 05be745  Fix message_bridge example crash scenario
05be745 is described below

commit 05be745b1dac4c1f2c32c2ea60d14ac42c03e557
Author: Zheng Feng <[email protected]>
AuthorDate: Sat Nov 25 00:13:55 2023 +0800

    Fix message_bridge example crash scenario
---
 message-bridge/README.adoc                                           | 5 -----
 .../src/main/java/org/acme/message/bridge/DummyXAResource.java       | 3 ++-
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/message-bridge/README.adoc b/message-bridge/README.adoc
index 6529f64..6a63216 100644
--- a/message-bridge/README.adoc
+++ b/message-bridge/README.adoc
@@ -119,15 +119,10 @@ Upon restarting the application, after a few seconds you 
will observe that the t
 2023-10-13 15:21:36,459 INFO  [io.quarkus] (main) Profile prod activated.
 2023-10-13 15:21:36,459 INFO  [io.quarkus] (main) Installed features: 
[artemis-jms, camel-attachments, camel-core, camel-direct, camel-jms, 
camel-jta, camel-platform-http, camel-rest, cdi, messaginghub-pooled-jms, 
narayana-jta, smallrye-context-propagation, vertx]
 2023-10-13 15:21:46,386 INFO  [org.acm.mes.bri.DummyXAResourceRecovery] 
(Periodic Recovery) DummyXAResourceRecovery returning list of resources: 
[org.acme.message.bridge.DummyXAResource@3739f1f4, 
org.acme.message.bridge.DummyXAResource@7d2113fb]
-2023-10-13 15:21:46,391 WARN  [com.arj.ats.jta] (Periodic Recovery) 
ARJUNA016037: Could not find new XAResource to use for recovering 
non-serializable XAResource XAResourceRecord < resource:null, txid:< 
formatId=131077, gtrid_length=35, bqual_length=36, 
tx_uid=0:ffffc0a80136:8e8b:65294417:31, node_name=quarkus, 
branch_uid=0:ffffc0a80136:8e8b:65294417:33, subordinatenodename=null, 
eis_name=0 >, heuristic: TwoPhaseOutcome.FINISH_OK 
com.arjuna.ats.internal.jta.resources.arjunacore.XAResourc [...]
-2023-10-13 15:21:46,483 INFO  [org.acm.mes.bri.DummyXAResourceRecovery] 
(Periodic Recovery) DummyXAResourceRecovery returning list of resources: 
[org.acme.message.bridge.DummyXAResource@24a51dd0, 
org.acme.message.bridge.DummyXAResource@4fc1b14d]
-2023-10-13 15:21:46,484 WARN  [com.arj.ats.jta] (Periodic Recovery) 
ARJUNA016038: No XAResource to recover < formatId=131077, gtrid_length=35, 
bqual_length=36, tx_uid=0:ffffc0a80136:8e8b:65294417:31, node_name=quarkus, 
branch_uid=0:ffffc0a80136:8e8b:65294417:33, subordinatenodename=null, 
eis_name=0 >
 2023-10-13 15:21:46,485 INFO  [org.acm.mes.bri.DummyXAResource] (Periodic 
Recovery) Committing DummyXAResource
 2023-10-13 15:21:46,512 INFO  [amq] (Camel (camel-1) thread #2 - 
JmsConsumer[in]) ActiveMQ received: crash
 ----
 
-You may observe the warning messages related to the XAResource recovery in the 
logs. This is a known issue related to how we simulate the crash of the system 
and can be ignored.
-
 === Package and run the application
 
 Once you are done with developing you may want to package and run the 
application.
diff --git 
a/message-bridge/src/main/java/org/acme/message/bridge/DummyXAResource.java 
b/message-bridge/src/main/java/org/acme/message/bridge/DummyXAResource.java
index 1a0dfba..c4c9757 100644
--- a/message-bridge/src/main/java/org/acme/message/bridge/DummyXAResource.java
+++ b/message-bridge/src/main/java/org/acme/message/bridge/DummyXAResource.java
@@ -31,12 +31,13 @@ import javax.transaction.xa.Xid;
 import com.arjuna.ats.arjuna.common.Uid;
 import org.eclipse.microprofile.config.ConfigProvider;
 import org.jboss.logging.Logger;
+import org.jboss.tm.FirstResource;
 
 /**
  * This class is used solely for simulating system crash.
  *
  */
-public class DummyXAResource implements XAResource {
+public class DummyXAResource implements XAResource, FirstResource {
     private static final Logger LOG = Logger.getLogger(DummyXAResource.class);
 
     private final boolean shouldCrash;

Reply via email to