0
目前我正在嘗試將消息放入json格式的隊列中。下面是我的代碼片段,但它不起作用。如何把msg作爲使用Spring集成的json格式排隊AMQP
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();
該消息在隊列中的推杆作爲應用程序/ x-java的序列化對象。
謝謝。解釋清楚。 – Kane