NServiceBus 和“死信”队列?
所以,我对 MSMQ 和 NServiceBus 很陌生。我尝试了演示并得到了一个与 NServiceBus 一起使用的工作场景。 (由于有了新的建模工具,我自己的启动和运行甚至比跟随演示更容易!)
然后我向我的同事展示了我的计划(基于我对演示和我自己的模型的工作)。其中两人精通使用 MSMQ,并开始问我如何处理“死信”的问题。
我从来没有听说过“死信”。他们解释说,这是一个队列,用于发送无法发送的消息(要么因为另一端拒绝它们,要么另一端不存在)。
我的同事担心的是,如果我们没有死信队列,那么我们如何阻止消息阻塞队列? (如果队列是 FIFO 并且顶部消息无法发送,那么它会阻塞后面的其他消息,对吧?)
另一方面,如果我们有“死信”队列,它们如何管理? (我是否从 NServiceBus 收到一个事件,告诉我死信队列中有一条新消息?如何配置消息何时进入死信队列?如何尝试重新发送死信消息?)
那么基本上,NServiceBus 如何处理无法送达的消息?
So, I am new to MSMQ and NServiceBus. I played around with demos and got a working scenario going with NServiceBus. (Getting my own up and running was even easier than following the demo thanks to the new Modeling tools!)
I then went and presented my plan (based off my work with the demo and my own model) to my co-workers. Two of them were versed in using MSMQ and started asking me questions about how I will handle "Dead Letters".
I had never heard of "Dead Letters". They explained that it is queue used for messages that things cannot be sent (either because the other end refuses them or if the other end is not there).
The concern of my co-workers is that if we don't have Dead Letter queues then how will we stop a message from blocking the queue? (If the queue is FIFO and the top message can't be sent, then it blocks the other messages behind it right?)
On the other hand, if we have "Dead Letter" queues how are they managed? (Do I get an event from NServiceBus that tells me a new message is in the Dead Letter queue? How do I configure when a message will go to the Dead Letter queue? How can I try to re-send a Dead Letter message?)
So basically, how does NServiceBus deal with undeliverable messages?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常,您还指定一个错误队列,这是无法发送的消息将进入的位置。看看他们的 MSMQ 示例:
http://docs.pspecial.net/nservicebus/msmq/transportconfig &
http://docs.pspecial.net/nservicebus/msmq/connection-strings
在这种情况下,错误队列将与输入队列驻留在同一台计算机上。如果愿意,这也可以是远程队列。 MaxRetries 是指在将其放入错误队列之前尝试发送的次数。不过,如何选择处理错误队列取决于您。
Typically, you specify an error queue as well, which is where messages that couldn't be sent will go. Look at their MSMQ example:
http://docs.particular.net/nservicebus/msmq/transportconfig &
http://docs.particular.net/nservicebus/msmq/connection-strings
In this scenario, the error queue will reside on the same machine as the input queue. This may also be a remote queue, if preferred. MaxRetries refers to the number of attempts to send before it gets put into the error queue. How you choose to handle the error queue is up to you, however.