Source:
<code>public void testCustomPartitionCountDoesNotOverridePartitioningIfSmaller() throws Exception { byte[] ratherBigPayload = new byte[2048]; Arrays.fill(ratherBigPayload, (byte) 65); KafkaTestBinder binder = getBinder(); DirectChannel moduleOutputChannel = new DirectChannel(); QueueChannel moduleInputChannel = new QueueChannel(); KafkaProducerProperties producerProperties = new KafkaProducerProperties(); <START> producerProperties.setPartitionCount(5); <END> producerProperties.setPartitionKeyExpression("payload"); KafkaConsumerProperties consumerProperties = new KafkaConsumerProperties(); consumerProperties.setMinPartitionCount(3); long uniqueBindingId = System.currentTimeMillis(); Binding<MessageChannel> producerBinding = binder.bindProducer("foo" + uniqueBindingId + ".0", moduleOutputChannel, producerProperties); Binding<MessageChannel> consumerBinding = binder.bindConsumer("foo" + uniqueBindingId + ".0", null, moduleInputChannel, consumerProperties); Message<?> message = org.springframework.integration.support.MessageBuilder.withPayload(ratherBigPayload).build(); binderBindUnbindLatency(); moduleOutputChannel.send(message); Message<?> inbound = receive(moduleInputChannel); assertNotNull(inbound); assertArrayEquals(ratherBigPayload, (byte[]) inbound.getPayload()); Collection<Partition> partitions = binder.getCoreBinder().getConnectionFactory().getPartitions( "foo" + uniqueBindingId + ".0"); assertThat(partitions, hasSize(5)); producerBinding.unbind(); consumerBinding.unbind(); }</code><technical_language>missing a new property equivalent for this?: producerProperties.put(BinderPropertyKeys.MIN_PARTITION_COUNT, "3");</technical_language>

Target:
public void testCustomPartitionCountDoesNotOverridePartitioningIfSmaller() throws Exception { byte[] ratherBigPayload = new byte[2048]; Arrays.fill(ratherBigPayload, (byte) 65); KafkaTestBinder binder = getBinder(); DirectChannel moduleOutputChannel = new DirectChannel(); QueueChannel moduleInputChannel = new QueueChannel(); KafkaProducerProperties producerProperties = new KafkaProducerProperties(); producerProperties.setPartitionCount(5); producerProperties.setPartitionKeyExpression(spelExpressionParser.parseExpression("payload")); KafkaConsumerProperties consumerProperties = new KafkaConsumerProperties(); consumerProperties.setMinPartitionCount(3); long uniqueBindingId = System.currentTimeMillis(); Binding<MessageChannel> producerBinding = binder.bindProducer("foo" + uniqueBindingId + ".0", moduleOutputChannel, producerProperties); Binding<MessageChannel> consumerBinding = binder.bindConsumer("foo" + uniqueBindingId + ".0", null, moduleInputChannel, consumerProperties); Message<?> message = org.springframework.integration.support.MessageBuilder.withPayload(ratherBigPayload).build(); binderBindUnbindLatency(); moduleOutputChannel.send(message); Message<?> inbound = receive(moduleInputChannel); assertNotNull(inbound); assertArrayEquals(ratherBigPayload, (byte[]) inbound.getPayload()); Collection<Partition> partitions = binder.getCoreBinder().getConnectionFactory().getPartitions( "foo" + uniqueBindingId + ".0"); assertThat(partitions, hasSize(5)); producerBinding.unbind(); consumerBinding.unbind(); }