title: Spring Cloud Stream Kafka: How to delay sending a message in a method annotated with @Transactional
body: <p>I need the producer to send messages to the topic after the completion of the method annotated as @Transactional, and if an exception is thrown in the method, the message should not be sent to the topic (or rolled back before the consumer reads it).
  Is it possible to configure the producer in this way?</p>
  <p><code>spring-cloud-stream-binder-kafka:3.1.1</code></p>
  <p>My application.yml configuration:</p>
  <pre><code>spring:
    cloud:
      stream:
        kafka:
          binder:
            transaction:
              transaction-id-prefix: tx-
              producer:
                configuration:
                  enable.idempotence: true
                  retries: 1
                  acks: all
  </code></pre>
  <p>P.S. In this configuration, the offset always commits.</p>