How does spring kafka achieve the designated partition of consumer consumption?

The native API of

kafka can use consumer.assign (partitions) to subscribe to the API of the specified partition, spring kafka. Is there a corresponding method? I only found @ KafkaListener (topicPartitions = {@ TopicPartition (topic = "topic1", partitions = {"0", "1"})} annotation, but when implemented in this way, the values of topic and partitions must be constant, but in fact, I need to determine that @ KafkaListener cannot be used according to the user"s id (get in operation). Is there any solution?

another: if you use the consumer.assign (partitions) method, is it true that the partition.assignment.strategy attribute will not take effect?

Sep.18,2021
How to solve

I also want to know


you can configure unified configuration partition rules among producers


encountered the same problem, but fortunately you have solved it and come back to share it.

you can write expressions from https://docs.spring.io/spring-kafka/docs/current/reference/html/-sharptip-assign-all-parts


with

@KafkaListener(topics = "-sharp{'${spring.kafka.topics}'.split(' ')}")
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e51353-27650.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e51353-27650.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?