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
<1> Inject the Hibernate Reactive `SessionFactory`.
3205
-
<2> Capture the caller Vert.x context.
3206
-
<3> Begin a Hibernate Reactive transaction.
3207
-
<4> Begin a Kafka transaction.
3208
-
<5> Persist the payload and send the entity to Kafka.
3209
-
<6> The Kafka transaction terminates on the Kafka producer sender thread.
3210
-
We need to switch to the Vert.x context previously captured in order to terminate the Hibernate Reactive transaction on the same context we started it.
3203
+
<2> Begin a Hibernate Reactive transaction.
3204
+
<3> Begin a Kafka transaction.
3205
+
<4> Persist the payload and send the entity to Kafka.
3206
+
3207
+
Alternatively, you can use the `@WithTransaction` annotation to start a transaction and commit it when the method returns:
Copy file name to clipboardExpand all lines: integration-tests/reactive-messaging-hibernate-orm/src/test/java/io/quarkus/it/kafka/KafkaConnectorTest.java
Copy file name to clipboardExpand all lines: integration-tests/reactive-messaging-hibernate-reactive/src/main/java/io/quarkus/it/kafka/KafkaEndpoint.java
+14
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,20 @@ public List<Person> getPeople() {
Copy file name to clipboardExpand all lines: integration-tests/reactive-messaging-hibernate-reactive/src/main/java/io/quarkus/it/kafka/KafkaReceivers.java
+15
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,8 @@ public class KafkaReceivers {
24
24
25
25
privatefinalList<Person> people = newCopyOnWriteArrayList<>();
0 commit comments