|
32 | 32 | import org.springframework.aop.support.AopUtils;
|
33 | 33 | import org.springframework.core.task.AsyncListenableTaskExecutor;
|
34 | 34 | import org.springframework.kafka.support.TopicPartitionOffset;
|
| 35 | +import org.springframework.kafka.transaction.KafkaTransactionManager; |
35 | 36 | import org.springframework.lang.Nullable;
|
36 | 37 | import org.springframework.scheduling.TaskScheduler;
|
37 | 38 | import org.springframework.transaction.PlatformTransactionManager;
|
@@ -748,16 +749,17 @@ public TransactionDefinition getTransactionDefinition() {
|
748 | 749 | /**
|
749 | 750 | * Set a transaction definition with properties (e.g. timeout) that will be copied to
|
750 | 751 | * the container's transaction template. Note that this is only generally useful when
|
751 |
| - * used with a |
752 |
| - * {@link org.springframework.kafka.transaction.ChainedKafkaTransactionManager} |
753 |
| - * configured with a non-Kafka transaction manager. Kafka has no concept of |
754 |
| - * transaction timeout, for example. |
| 752 | + * used with a {@link #setTransactionManager(PlatformTransactionManager) |
| 753 | + * PlatformTransactionManager} that supports a custom definition; this does NOT |
| 754 | + * include the {@link KafkaTransactionManager} which has no concept of transaction |
| 755 | + * timeout. It can be useful to start, for example a database transaction, in the |
| 756 | + * container, rather than using {@code @Transactional} on the listener, because then a |
| 757 | + * record interceptor, or filter in a listener adapter can participate in the |
| 758 | + * transaction. |
755 | 759 | * @param transactionDefinition the definition.
|
756 | 760 | * @since 2.5.4
|
757 |
| - * @deprecated Refer to the |
758 |
| - * {@link org.springframework.data.transaction.ChainedTransactionManager} javadocs. |
| 761 | + * @see #setTransactionManager(PlatformTransactionManager) |
759 | 762 | */
|
760 |
| - @Deprecated |
761 | 763 | public void setTransactionDefinition(TransactionDefinition transactionDefinition) {
|
762 | 764 | this.transactionDefinition = transactionDefinition;
|
763 | 765 | }
|
|
0 commit comments