MessageListener { String listenerThreadName(String name, int index) { return "kafka-listener-" + (name == null ? "" : name + "-") + index; } MessageListener(KafkaURI uri, String name, LogManager logManager); void subscribe(String topic, Class<T> messageClass, MessageHandler<T> handler, BulkMessageHandler<T> bulkHandler); void start(); void shutdown(); void awaitTermination(long timeoutInMs); final ConsumerMetrics consumerMetrics; public int poolSize; public Duration maxProcessTime; public Duration longConsumerDelayThreshold; public int maxPollRecords; public int maxPollBytes; public int minPollBytes; public Duration maxWaitTime; public String groupId; }
@Test void listenerThreadName() { assertThat(listener.listenerThreadName(null, 0)).isEqualTo("kafka-listener-0"); assertThat(listener.listenerThreadName("name", 2)).isEqualTo("kafka-listener-name-2"); }