Skip to content

Commit

Permalink
Merge branch 'improve_consumerId' into 'master'
Browse files Browse the repository at this point in the history
improve distribution of partitions across replicas

See merge request hercules/hercules!433
  • Loading branch information
petr-stb committed Oct 26, 2022
2 parents a0e0b35 + ca7817a commit d61dd89
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public Sink(

Properties consumerProperties = PropertiesUtil.ofScope(properties, Scopes.CONSUMER);
consumerProperties.put(ConsumerConfig.GROUP_ID_CONFIG, consumerGroupId);
String consumerId = Application.context().getInstanceId() + "-" + CONSUMER_CLIENT_ID_SEQUENCE.getAndIncrement();
String consumerId = CONSUMER_CLIENT_ID_SEQUENCE.getAndIncrement() + "-" + Application.context().getInstanceId();
consumerProperties.put(ConsumerConfig.CLIENT_ID_CONFIG, consumerId);
consumerProperties.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false);
consumerProperties.putIfAbsent(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, batchSize);
Expand Down

0 comments on commit d61dd89

Please sign in to comment.