I am using Spring cloud stream kafka for consuming and sending the message to another topic. I have setup compression-type as gzip and have partition Id as well like below which worked fine.
spring:
cloud:
stream:
bindings:
test-out-0:
destination: test
producer:
partition-key-expression: headers['partitionKey']
kafka:
bindings:
test-out-0:
producer:
compression-type: gzip
I have a requirement where I have to send message to multiple topics which are dynamic in nature as I'll get the topic names in header. I am using StreamBridge to send message to outbound topics and as I said I am getting topic name from header. This worked fine but I want to pass partition Key as well. I couldnt find any config to pass partitionId for dynamic binder. Can somebody please help me to find what is the correct way to pass partition key.
Thanks