-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi-language docs examples for client batch examples (#834)
- Loading branch information
Showing
11 changed files
with
120 additions
and
26 deletions.
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
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
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
34 changes: 34 additions & 0 deletions
34
test-suite-groovy/src/test/groovy/io/micronaut/kafka/docs/consumer/batch/BookClient.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,34 @@ | ||
package io.micronaut.kafka.docs.consumer.batch | ||
|
||
import io.micronaut.configuration.kafka.annotation.KafkaClient | ||
import io.micronaut.configuration.kafka.annotation.Topic | ||
import io.micronaut.context.annotation.Requires | ||
import io.reactivex.Flowable | ||
import org.apache.kafka.clients.producer.RecordMetadata | ||
|
||
@Requires(property = 'spec.name', value = 'BookListenerTest') | ||
// tag::clazz[] | ||
@KafkaClient(batch = true) | ||
interface BookClient { | ||
// end::clazz[] | ||
|
||
// tag::lists[] | ||
@Topic('books') | ||
void sendList(List<Book> books) | ||
// end::lists[] | ||
|
||
// tag::arrays[] | ||
@Topic('books') | ||
void sendBooks(Book...books) | ||
// end::arrays[] | ||
|
||
// tag::reactive[] | ||
@Topic('books') | ||
Flowable<RecordMetadata> send(List<Book> books) | ||
// end::reactive[] | ||
|
||
// tag::flowable[] | ||
@Topic('books') | ||
Flowable<RecordMetadata> send(Flowable<Book> books) | ||
// end::flowable[] | ||
} |
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
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
34 changes: 34 additions & 0 deletions
34
test-suite-kotlin/src/test/kotlin/io/micronaut/kafka/docs/consumer/batch/BookClient.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,34 @@ | ||
package io.micronaut.kafka.docs.consumer.batch | ||
|
||
import io.micronaut.configuration.kafka.annotation.KafkaClient | ||
import io.micronaut.configuration.kafka.annotation.Topic | ||
import io.micronaut.context.annotation.Requires | ||
import io.reactivex.Flowable | ||
import org.apache.kafka.clients.producer.RecordMetadata | ||
|
||
@Requires(property = "spec.name", value = "BookListenerTest") | ||
// tag::clazz[] | ||
@KafkaClient(batch = true) | ||
interface BookClient { | ||
// end::clazz[] | ||
|
||
// tag::lists[] | ||
@Topic("books") | ||
fun sendList(books: List<Book>) | ||
// end::lists[] | ||
|
||
// tag::arrays[] | ||
@Topic("books") | ||
fun sendBooks(vararg books: Book) | ||
// end::arrays[] | ||
|
||
// tag::reactive[] | ||
@Topic("books") | ||
fun send(books: List<Book>): Flowable<RecordMetadata> | ||
// end::reactive[] | ||
|
||
// tag::flowable[] | ||
@Topic("books") | ||
fun send(books: Flowable<Book>): Flowable<RecordMetadata> | ||
// end::flowable[] | ||
} |
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
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
36 changes: 36 additions & 0 deletions
36
test-suite/src/test/java/io/micronaut/kafka/docs/consumer/batch/BookClient.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,36 @@ | ||
package io.micronaut.kafka.docs.consumer.batch; | ||
|
||
import io.micronaut.configuration.kafka.annotation.KafkaClient; | ||
import io.micronaut.configuration.kafka.annotation.Topic; | ||
import io.micronaut.context.annotation.Requires; | ||
import io.reactivex.Flowable; | ||
import org.apache.kafka.clients.producer.RecordMetadata; | ||
|
||
import java.util.List; | ||
|
||
@Requires(property = "spec.name", value = "BookListenerTest") | ||
// tag::clazz[] | ||
@KafkaClient(batch = true) | ||
public interface BookClient { | ||
// end::clazz[] | ||
|
||
// tag::lists[] | ||
@Topic("books") | ||
void sendList(List<Book> books); | ||
// end::lists[] | ||
|
||
// tag::arrays[] | ||
@Topic("books") | ||
void sendBooks(Book...books); | ||
// end::arrays[] | ||
|
||
// tag::reactive[] | ||
@Topic("books") | ||
Flowable<RecordMetadata> send(List<Book> books); | ||
// end::reactive[] | ||
|
||
// tag::flowable[] | ||
@Topic("books") | ||
Flowable<RecordMetadata> send(Flowable<Book> books); | ||
// end::flowable[] | ||
} |
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