0
如何返回addAnnonceInput接收到的message1,我需要將該消息返回給客戶端。Spring Cloud Stream RabbitMQ
@RequestMapping(method = RequestMethod.POST, value = "/annonces")
public void addAnnonce(@RequestBody AnnonceWrapper annonceWrapper) {
System.out.println(annonceWrapper.toString());
final Message<AnnonceWrapper> message = MessageBuilder
.withPayload(annonceWrapper)
.setReplyChannel(messageStream.acceptDemandeInput())
.build();
messageStream.addAnnonceOutput().send(message);
messageStream.acceptDemandeInput().subscribe(message1 -> System.out.println(message1.getPayload().toString()));
}