You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use ReplyingKafkaTemplate in order to implement Request-Reply messaging pattern with Kafka having end-to-end transactionality. I have tried many solutions and I concluded to the following code having the following issue:
Caused by: java.lang.IllegalStateException: No transaction is in process; possible solutions: run the template operation within the scope of a template.executeInTransaction() operation, start a transaction with @transactional before invoking the template method, run in a transaction started by a listener container when consuming a record
With using KafkaTemplate I am able to send event to the target topic and many others with transactionality. The issues arise with ReplyingKafkaTemplate.
Reproduce
Create and send events to the topic that I want to get a synchronous reply.
Expected behavior
I want the listener to process the event and send back the reponse. I suppose that as the proper @transactional annotations are in place there should not be and issue with transactionality.
Version(s) of Spring for Apache Kafka
3.4
Description
I want to use ReplyingKafkaTemplate in order to implement Request-Reply messaging pattern with Kafka having end-to-end transactionality. I have tried many solutions and I concluded to the following code having the following issue:
With using KafkaTemplate I am able to send event to the target topic and many others with transactionality. The issues arise with ReplyingKafkaTemplate.
Reproduce
Create and send events to the topic that I want to get a synchronous reply.
Expected behavior
I want the listener to process the event and send back the reponse. I suppose that as the proper @transactional annotations are in place there should not be and issue with transactionality.
Code
Configuration
KafkaListener
SynchronousTestEventService processing event from KafkaListener
Method generating an event to be sent using ReplyingKafkaTemplate
Method sending event to using ReplyingKafkaTemplate
Logs
The text was updated successfully, but these errors were encountered: