in testkit/src/main/scala/org/apache/pekko/kafka/testkit/internal/KafkaTestKit.scala [46:100]
def producerDefaults: ProducerSettings[String, String] = producerDefaults(StringSerializer, StringSerializer)
def producerDefaults[K, V](keySerializer: Serializer[K], valueSerializer: Serializer[V]): ProducerSettings[K, V] =
ProducerSettings(system, keySerializer, valueSerializer)
.withBootstrapServers(bootstrapServers)
def consumerDefaults: ConsumerSettings[String, String] = consumerDefaults(StringDeserializer, StringDeserializer)
def consumerDefaults[K, V](keyDeserializer: Deserializer[K],
valueDeserializer: Deserializer[V]): ConsumerSettings[K, V] =
ConsumerSettings(system, keyDeserializer, valueDeserializer)
.withBootstrapServers(bootstrapServers)
.withProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest")
private lazy val committerDefaultsInstance = CommitterSettings(system)
def committerDefaults: CommitterSettings = committerDefaultsInstance
private def nextNumber(): Int = KafkaTestKitClass.topicCounter.incrementAndGet()
/**
* Return a unique topic name.
*/
def createTopicName(suffix: Int): String = s"topic-$suffix-${nextNumber()}"
/**
* Return a unique group id with a default suffix.
*/
def createGroupId(): String = createGroupId(0)
/**
* Return a unique group id with a given suffix.
*/
def createGroupId(suffix: Int): String = s"group-$suffix-${nextNumber()}"
/**
* Return a unique transactional id with a default suffix.
*/
def createTransactionalId(): String = createTransactionalId(0)
/**
* Return a unique transactional id with a given suffix.
*/
def createTransactionalId(suffix: Int): String = s"transactionalId-$suffix-${nextNumber()}"
def system: ActorSystem
def bootstrapServers: String
val settings = KafkaTestkitSettings(system)
private lazy val adminDefaults: java.util.Map[String, AnyRef] = {
val config = new java.util.HashMap[String, AnyRef]()
config.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers)
config
}