1
如何確保Spring Cloud Stream Rabbit保證交付。我的代碼如下: -Spring Cloud Stream Rabbit交付確認
class Source {
MessageChannel output;
Repository repo;
@Transactional
void publisher(Command command){
repo.save(command);
output.send(MessageBuilder
.withPayload(new Event()).build());
}
}
class Sink {
@StreamListener(Event.class)
void eventListener(Event event){
// method body
}
}
任何幫助表示讚賞。
的文檔謝謝,如果消息失敗,生產者重試和多久? – aprofromindia
不知道生產者重試是什麼意思,因爲我指的是消費者方面的acknowledgeMode。如果您的意思是在消費者方面重試,您可以參考此文檔:http://docs.spring.io/spring-cloud-stream/docs/Chelsea.BUILD-SNAPSHOT/reference/htmlsingle/index.html#_retry_with_the_rabbitmq_binder –