I have a producer with following configuration for content-type
spring:
cloud:
stream:
bindings:
eventOut:
destination: lab_csi
content-type: application/json
On consumer side I use spring integration (KinesisMessageDrivenChannelAdapter) to route event to different channels.When I receive Message on listener class like below:
@ServiceActivator(inputChannel = "channelA")
void handleMessage(Message<?> msg) {
objectMapper.readValue(msg.getPayload(), MyEvent.class);
}
the marshalling to MyEvent fails. In the stack error I can see that content-type is part of payload and payload is not still deserialized from json to POJO.
I am wondering how I can deserialize message before doing any other transformation. I don't find any method that I can set a MessageConverter to the adapter.
I appreciate your help.
Thank you