Replies: 1 comment 11 replies
-
The transaction is started around
So, when Rabbit transaction is there, it is indeed wrong to use Looks like the
I think the mentioned logic in the As a workaround I only see a way to set
Does that make sense to you? |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
In our spring application we are using a transaction to mysql and to rabbitmq. We are using spring boot 3.2.4 and spring amqp 3.1.3.
We rely on the Best Effort One Phase Commit, with a commit to the DB and then Rabbitmq committing. We wanted to make use of the checkAfterCompletion method described here: https://docs.spring.io/spring-amqp/reference/amqp/transactions.html#tx-sync to log when the Rabbitmq transaction fails but the DB one succeeded.
However we're not quite sure where to set that up. We have tried to create a non-transactional receiver which delegates to a transactional one:
With the message processor looking like:
The chain of event as I understand it is:
org.springframework.amqp.rabbit.connection.RabbitUtils#commitIfNecessary is eventually called and may fail without us being able to be notified by it.
There is no obvious place where I can call the checkAfterCompletion after that rabbitmq commit occurs and google doesn't seem to have examples.
Do you have any advice on how to move forward with this please? I hope this is the right place to ask the question.
Beta Was this translation helpful? Give feedback.
All reactions