Not removing producers means we do not explicitly close them, so we don't need all the locking code around take/terminate/release in KafkaFactory.
Note the change in KafkaTopicRepository::listPartitionNames: use admin client instead of some producer, because we need the up-to-date result, not some cached value. This call is not used in hot path, as the partitions list is storead in the EventTypeCache. Also when invalidating that cache entry we need to fetch an up-to-date value.
Not removing producers means we do not explicitly close them, so we don't need all the locking code around take/terminate/release in
KafkaFactory
.Note the change in
KafkaTopicRepository::listPartitionNames
: use admin client instead of some producer, because we need the up-to-date result, not some cached value. This call is not used in hot path, as the partitions list is storead in theEventTypeCache
. Also when invalidating that cache entry we need to fetch an up-to-date value.