Currently I'm trying to put a message to queue with json format. Below it's my code snippet but it does not work.
return IntegrationFlows.from(Amqp.inboundAdapter(connectionFactory, NOTE_INCOMING_QUEUE)
.concurrentConsumers(2))
.transform(new JsonToObjectTransformer(Note.class))
.handle(Note.class, (note, header) -> {
// doing something
return note;
})
.channel(Amqp.channel(connectionFactory).queueName(NOTE_OCRED_QUEUE).messageConverter(
new MappingJackson2MessageConverter()))
.get();
The message was putted in queue as application/x-java-serialized-object.
Two problems:
Use an outbound channel adapter...
Where the
RabbitTemplate
is configured with aJackson2JsonMessageConverter
.