MSMQ 4.0& 。网
有没有办法让 MSMQ 调用用 .NET 编写的 dll?例如,我想创建一个消息队列来接受带有标签的消息。那么,队列可以根据标签中的值调用不同的类对象吗?
我研究了一些触发器,但不确定这是否是我可以采取的唯一途径。
我需要创建一个监控队列的程序/服务吗?我认为这是旧的方法,但我似乎找不到任何没有监视队列的程序/服务的示例。
Is there a way that MSMQ would invoke a dll written in .NET? For example, I would like to create a messaging queue that would accept messages with a label. Then, can the queue invoke a different class object, based on the value in the label?
I looked a bit into triggers, but not sure if that is the only route that I can take.
Will I need to create a program/service that monitors the queue? I thought that was the old way, but I can't seem to find any examples that do not have program/service that monitors the queue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的选择几乎要么是触发器,要么是 Windows 服务。如果您使用触发器,您需要构建一个 exe 或 COM 对象来包装您的 .Net DLL。否则,您可以构建一个服务并在 MSMQ 中注册适当的 receive* 事件。
您可以采用下面带有 MSMQ 通道的 WCF 方式,但这可能也需要您的客户端进行更改,因为消息必须以某种方式格式化。
最重要的是,您有两个激活选项:主动(使用触发器)和被动(使用 Windows 服务)。
Your options are pretty much either triggers or Windows Service. Should you go with triggers, you'd want to build an exe or a COM object wrapping your .Net DLL. Otherwise, you could build a service and register for an appropriate receive* event in MSMQ.
You could go the way of WCF with MSMQ channel underneath, but that likely requires that your client changes as well, as the messages will have to be formatted a certain way.
Bottom line you have two activation options: active, using triggers, and passive using Windows Service.