Merge pull request #1172 from sobychacko/fix-partitioning-interceptor

Fix PartitioningInterceptor CCE
This commit is contained in:
Oleg Zhurakousky
2021-11-29 18:12:59 +01:00
committed by GitHub

View File

@@ -419,10 +419,14 @@ public class KafkaMessageChannelBinder extends
List<ChannelInterceptor> interceptors = ((InterceptableChannel) channel)
.getInterceptors();
interceptors.forEach((interceptor) -> {
if (interceptor instanceof PartitioningInterceptor || interceptor instanceof DefaultPartitioningInterceptor) {
if (interceptor instanceof PartitioningInterceptor) {
((PartitioningInterceptor) interceptor)
.setPartitionCount(partitions.size());
}
else if (interceptor instanceof DefaultPartitioningInterceptor) {
((DefaultPartitioningInterceptor) interceptor)
.setPartitionCount(partitions.size());
}
});
}