-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transactional Kafka Producer per thread (#882)
* Update documentation * Add code snippets
- Loading branch information
1 parent
3bafac8
commit b5b2944
Showing
7 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...rc/test/groovy/io/micronaut/kafka/docs/producer/config/RandomTransactionalIdClient.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.micronaut.kafka.docs.producer.config | ||
|
||
import io.micronaut.configuration.kafka.annotation.KafkaClient | ||
import io.micronaut.context.annotation.Prototype | ||
import io.micronaut.context.annotation.Requires | ||
|
||
@Requires(property = "spec.name", value = "RandomTransactionalIdClientTest") | ||
// tag::clazz[] | ||
@Prototype | ||
@KafkaClient(id = "my-client", transactionalId = 'my-tx-id-${random.uuid}') | ||
interface RandomTransactionalIdClient { | ||
// define client API | ||
} | ||
// end::clazz[] |
12 changes: 12 additions & 0 deletions
12
...groovy/src/test/groovy/io/micronaut/kafka/docs/producer/config/TransactionalClient.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.micronaut.kafka.docs.producer.config | ||
|
||
import io.micronaut.configuration.kafka.annotation.KafkaClient | ||
import io.micronaut.context.annotation.Requires | ||
|
||
@Requires(property = "spec.name", value = "TransactionalClientTest") | ||
// tag::clazz[] | ||
@KafkaClient(id = "my-client", transactionalId = "my-tx-id") | ||
interface TransactionalClient { | ||
// define client API | ||
} | ||
// end::clazz[] |
14 changes: 14 additions & 0 deletions
14
...in/src/test/kotlin/io/micronaut/kafka/docs/producer/config/RandomTransactionalIdClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.micronaut.kafka.docs.producer.config | ||
|
||
import io.micronaut.configuration.kafka.annotation.KafkaClient | ||
import io.micronaut.context.annotation.Prototype | ||
import io.micronaut.context.annotation.Requires | ||
|
||
@Requires(property = "spec.name", value = "RandomTransactionalIdClientTest") | ||
// tag::clazz[] | ||
@Prototype | ||
@KafkaClient(id = "my-client", transactionalId = "my-tx-id-\${random.uuid}") | ||
interface RandomTransactionalIdClient { | ||
// define client API | ||
} | ||
// end::clazz[] |
12 changes: 12 additions & 0 deletions
12
...ite-kotlin/src/test/kotlin/io/micronaut/kafka/docs/producer/config/TransactionalClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.micronaut.kafka.docs.producer.config | ||
|
||
import io.micronaut.configuration.kafka.annotation.KafkaClient | ||
import io.micronaut.context.annotation.Requires | ||
|
||
@Requires(property = "spec.name", value = "TransactionalClientTest") | ||
// tag::clazz[] | ||
@KafkaClient(id = "my-client", transactionalId = "my-tx-id") | ||
interface TransactionalClient { | ||
// define client API | ||
} | ||
// end::clazz[] |
14 changes: 14 additions & 0 deletions
14
...te/src/test/java/io/micronaut/kafka/docs/producer/config/RandomTransactionalIdClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.micronaut.kafka.docs.producer.config; | ||
|
||
import io.micronaut.configuration.kafka.annotation.KafkaClient; | ||
import io.micronaut.context.annotation.Prototype; | ||
import io.micronaut.context.annotation.Requires; | ||
|
||
@Requires(property = "spec.name", value = "RandomTransactionalIdClientTest") | ||
// tag::clazz[] | ||
@Prototype | ||
@KafkaClient(id = "my-client", transactionalId = "my-tx-id-${random.uuid}") | ||
public interface RandomTransactionalIdClient { | ||
// define client API | ||
} | ||
// end::clazz[] |
12 changes: 12 additions & 0 deletions
12
test-suite/src/test/java/io/micronaut/kafka/docs/producer/config/TransactionalClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.micronaut.kafka.docs.producer.config; | ||
|
||
import io.micronaut.configuration.kafka.annotation.KafkaClient; | ||
import io.micronaut.context.annotation.Requires; | ||
|
||
@Requires(property = "spec.name", value = "TransactionalClientTest") | ||
// tag::clazz[] | ||
@KafkaClient(id = "my-client", transactionalId = "my-tx-id") | ||
public interface TransactionalClient { | ||
// define client API | ||
} | ||
// end::clazz[] |