![](/img/trans.png)
[英]Spring Integration - queue with message store - How to check persisted messages in the DB
[英]Spring Integration: How to read the unconsumed messages in the queue?
我正在嘗試在隊列通道中讀取未使用的消息。 但是找不到辦法。 可能嗎? 如果是,請指出正確的文檔。
目的是公開一個API,以便客戶端可以在UI上看到掛起的項目。
謝謝,
您可以簡單地在ServiceActivator之一中引用“隊列通道”,並對消息執行任何操作:
@MessageEndpoint(value = "jobQueuer")
public class JobStartupQueuer {
@Resource
private Queue<Message> jobChannelQueue;
public boolean accept(Message<?> message) {
LOG.info("Channel size: {}", jobChannelQueue.size());
return true;
}
}
這樣就注入了jobChannelQueue,因此在您的ServiceActivator處理方法(例如accept)中,我們可以引用隊列及其內部消息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.