i am posting below data into kafka and receive through spring integration channels and transform into Log object, how do i transform below data into Log object using spring integration transformer? appreciate any help here
'Log(clientKey=string, payload=string)'
Here is the channel adapter code
@Bean
public KafkaMessageDrivenChannelAdapter<String, String> kafkaMessageDrivenChannelAdapter() {
KafkaMessageDrivenChannelAdapter<String, String> kafkaMessageDrivenChannelAdapter = new KafkaMessageDrivenChannelAdapter<>(
kafkaListenerContainer());
kafkaMessageDrivenChannelAdapter.setPayloadType(Log.class);
kafkaMessageDrivenChannelAdapter.setOutputChannel(inputChannel());
return kafkaMessageDrivenChannelAdapter;
}
when i try to convert within the service activator using below
ObjectMapper objectMapper = new ObjectMapper();
Log msg = objectMapper.readValue(arg0.getPayload().toString() , Log.class);
its failing with
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Log': was expecting ('true', 'false' or 'null')