-
Notifications
You must be signed in to change notification settings - Fork 15
Custom batch settings on a producer #237
Copy link
Copy link
Open
Labels
api: pubsubliteIssues related to the googleapis/java-pubsublite-kafka API.Issues related to the googleapis/java-pubsublite-kafka API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
Would the library support setting my own batch settings on a producer? Right now a default is passed in.
java-pubsublite-kafka/src/main/java/com/google/cloud/pubsublite/kafka/ProducerSettings.java
Lines 57 to 78 in 14a7055
| 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) { |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: pubsubliteIssues related to the googleapis/java-pubsublite-kafka API.Issues related to the googleapis/java-pubsublite-kafka API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.