I'm new in java, spring and kafka
I have the next code for sending message
kafkaTemplate.send(topic, message);
My configuration for producer:
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,
bootstrapServers);
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,
IntegerSerializer.class);
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG,
StringSerializer.class);
// value to block, after which it will throw a TimeoutException
props.put(ProducerConfig.MAX_BLOCK_MS_CONFIG, 5000);
I want to send message with my consumer group (example "MyConsumerGroup"),
but I don't know how I can to do it
thanks for help
The concept of "consumer groups" only applies to consumers (as the name suggest). If you write a message to Kafka, any consumer group can read the message later on.
Thus, if you write a message, specifying a consumer group is not possible because it would not make any sense.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With