2
我試圖使用春天的雲流發送消息,但我沒有找到我如何發送消息,並獲得相同的方法返回,與我使用rabbitTemplate相同。如何發送和等待春季雲流RabbitMQ的返回消息?
RabbitTemplate template = new RabbitTemplate(cf);
//configs template here...
Object test = template.convertSendAndReceive("Hello world");
//On Cloud Stream
private MessageChannel output;
public <T extends DomainEvent> void publish(T domainEvent){
output.send(MessageBuilder.withPayload(domainEvent).build());
//How to wait and receive the answer?
}
好的,謝謝你的迴應Gary,但是我可以在沒有衝突問題的情況下使用rabbitTemplate和spring stream嗎?這是否很好,我需要消費者的迴應:( –
是的,你可以在流應用程序中使用兔子模板。 –