Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Custom batch settings on a producer #237

Open
anguillanneuf opened this issue Oct 13, 2021 · 0 comments
Open

Custom batch settings on a producer #237

anguillanneuf opened this issue Oct 13, 2021 · 0 comments
Labels
api: pubsublite Issues related to the googleapis/java-pubsublite-kafka API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@anguillanneuf
Copy link
Contributor

Would the library support setting my own batch settings on a producer? Right now a default is passed in.

public Producer<byte[], byte[]> instantiate() throws ApiException {
PartitionCountWatchingPublisherSettings publisherSettings =
PartitionCountWatchingPublisherSettings.newBuilder()
.setTopic(topicPath())
.setAdminClient(newAdminClient())
.setPublisherFactory(
partition -> {
try {
return SinglePartitionPublisherBuilder.newBuilder()
.setServiceClient(
PublisherServiceClient.create(
ServiceClients.addDefaultSettings(
topicPath().location().extractRegion(),
ServiceClients.addDefaultMetadata(
PubsubContext.of(FRAMEWORK),
RoutingMetadata.of(topicPath(), partition),
PublisherServiceSettings.newBuilder()))))
.setTopic(topicPath())
.setPartition(partition)
.setBatchingSettings(DEFAULT_BATCHING_SETTINGS)
.build();
} catch (Throwable t) {

@product-auto-label product-auto-label bot added the api: pubsublite Issues related to the googleapis/java-pubsublite-kafka API. label Oct 13, 2021
@meredithslota meredithslota added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Oct 26, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
api: pubsublite Issues related to the googleapis/java-pubsublite-kafka API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants