.net 4.0 和 server 2008 的 MSMQ wcf 激活问题
我有从 net 3.5 移植的 .net 4.0 应用程序,该应用程序使用在服务器 2008 x64 上运行的 net.msmq
设置
- net.msmq 服务,地址为“net.msmq://localhost/private/msmqdataservice.svc”
- net.msmq 端点地址为“net” .msmq://localhost/private/msmqdataservice.svc"
- MSMQ 中的队列 -> name = "$private\msmqdataservice.svc"
现在一切都在使用 .net 3.5 进行生产。
我在服务器上安装了 .net 4.0 并创建了新站点以在同一台机器上进行暂存。
新的暂存 msmq 设置是
- net.msmq 服务,地址为“net.msmq://localhost/private/staging/msmqdataservice.svc”
- net.msmq 端点,地址为“net.msmq://localhost/private/staging/msmqdataservice.svc” "
- MSMQ 中的队列 -> name = "$private\staging/msmqdataservice.svc"
为不同站点创建另一个队列。
我对新站点所做的另一个更改是,这是 iis 中的不同站点,监听不同的 IP 地址。我已将 net.msmq 绑定到“localhost”。主站点也具有相同的 net.msmq 绑定 -> '本地主机'。我认为事情应该如此。如果需要一些不同的配置,请指出。
问题是我的请求正在排队,但没有被应用程序接收,它只是停留在那里
日志中没有任何错误迹象。我在与此相关的日志中看到的唯一一件事是警告“msmqactivation 无法发现队列”。虽然这个警告我从来没有正确理解过,因为我们在 3.5 中的 msmq 中总是看到这一点,一切都很好。
我能想到的任何事情都经过验证并且是正确的。
- 应用程序的应用程序池作为网络服务运行,并且具有对队列的完全访问权限。
- net.msmq 激活服务与网络服务一起运行
- 尝试了不同的服务 URL 命名约定,但结果相同
摘要
请提供有关使用 net.msmq 设置多个站点的任何见解。我对两个站点都使用 net.msmq 绑定 value = 'localhost'。我认为这是机器名标识。
有什么方法可以诊断这个问题吗?
您想到的任何其他事情都可能有所帮助。
昨天我们不得不推迟发布,因为在花费了大约 100 个工时后我们无法弄清楚问题所在。也无法让它在我的开发机器上崩溃。
编辑
问题是,创建新站点命名约定后,无法像
地址为“net.msmq://localhost/private/staging/msmqdataservice.svc”的 net.msmq 服务 一样工作 地址为“net.msmq://localhost/private/staging/msmqdataservice.svc”的 net.msmq 端点 MSMQ 中的队列 -> name = "$private\staging/msmqdataservice.svc"
它与服务名称一起使用 net.msmq://localhost/private/msmqdataservice.svc
但现在我不能让两个站点使用完全相同的端点。
有什么办法可以在同一台机器上具有不同 url 和不同队列的两个不同站点中拥有相同的端点吗?
I have .net 4.0 application ported from net 3.5 that uses net.msmq running on server 2008 x64
Setup
- net.msmq Service with address "net.msmq://localhost/private/msmqdataservice.svc"
- net.msmq endpoing with address "net.msmq://localhost/private/msmqdataservice.svc"
- queue in MSMQ -> name = "$private\msmqdataservice.svc"
everything is working on production right now with .net 3.5.
I installed .net 4.0 on server and created new site to for staging on same box.
New staging msmq setup is
- net.msmq Service with address "net.msmq://localhost/private/staging/msmqdataservice.svc"
- net.msmq endpoing with address "net.msmq://localhost/private/staging/msmqdataservice.svc"
- queue in MSMQ -> name = "$private\staging/msmqdataservice.svc"
Created another queue for different site.
Another change i made with new site is this is different site in iis with listening on different ip address. I have left net.msmq binding to 'localhost'. Main site as well has same binding for net.msmq -> 'localhost'. I think that's how it should be. Please point out if need some different configuration.
Issue is my requests are making into queue but not getting picked up by application it just stays there
There is no indication of anything wrong in log. Only thing i am seeing in log related to this is a warning "msmqactivation cannot discover queue". Although this warning i have never understood correctly as we have been seeing this always with everything fine with msmq in 3.5.
Anything i can think is verified and it's correct.
- Application's app pool is running as network service and it has full access to queue.
- net.msmq activation service is running with network service
- Tried different naming convention of service url with same result
Summary
Please provide any insight into multiple sites setup with net.msmq. I am using net.msmq binding with value = 'localhost' for both site. I think it's machinename identity.
Any way to diagnose this issue?
Any thing else you may think of may help.
We had to hold off release yesterday as after spending like 100 man hours we can't figure out what's the issue is. Also can't make it break in my development machine.
Edit
Issue was that after creating new site naming convention does not work like
net.msmq Service with address "net.msmq://localhost/private/staging/msmqdataservice.svc"
net.msmq endpoing with address "net.msmq://localhost/private/staging/msmqdataservice.svc"
queue in MSMQ -> name = "$private\staging/msmqdataservice.svc"
it worked with service name
net.msmq://localhost/private/msmqdataservice.svc
but now i cannot have two sites using exactly same endpoint.
Any way to have same endpoint in two different site with different url and different queue in same machine?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
对我来说,修复方法是安装 AppFabric for Windows Server v1.1。 (对于任何使用 WAS/IIS 托管的 WCF 服务或 WF 应用程序的人来说都是必须的。)
这也纠正了我每次创建非 WCF 队列时 WAS 进程崩溃的问题。即时调试器抛出这个问题:
我想没有多少人需要在同一台机器上混合使用 WCF/非 WCF 队列。希望这可以帮助某人摆脱我过去一周所经历的痛苦!
The fix for me was to install AppFabric for Windows Server v1.1. (Must have for anyone using WAS/IIS hosted WCF services or WF applications.)
This also corrected an issue I was having with the WAS process crashing every time I created a non-WCF queue. The Just-In-Time debugger was throwing this:
I guess not many people need to mix WCF/non-WCF queues on the same machine. Hope this saves someone from the pain I've gone through this past week!
使用不同的端口怎么样?您可以使用相同的主机名并告诉 WAS 在新虚拟目录或站点中的新端口上激活。
How about using a different port? You can use the same host name and tell WAS to activate on the new port in a new vdir or site.
不幸的是,侦听器使用服务名称来确定要侦听哪个队列,因此如果您的接收服务被调用,
您的队列应该被调用
因此,队列被调用:
尝试一下并回复我。我可以发布有效配置的完整示例。
我发现,即使您可能没有 2 个不同的端点,您也可以使用具有不同命名空间(或只是重命名服务)的相同服务来监听不同的队列。并不理想,但这是我发现唯一可行的方法。
Unfortunately, the listener uses the service name to determine which queue to listen for so if your receiving service is called
your queue should be called
So, the queue is called:
Try this out and get back to me. I can post a full example of the config that works.
It occurs to me that even though you may not have 2 different endpoints, you could have the same service with a different namespace (or just rename the service) listening to a different queue. Not ideal, but it's the only thing I found that would work.
您的服务端点的 URI 必须匹配(或多或少,参见 http://msdn .microsoft.com/en-us/library/ms789042.aspx) 队列名称。因此,这里的解决方案是创建一个名为 staging 的虚拟目录并将您的服务放在那里。
至于绑定信息,localhost 指向队列侦听器应该侦听的服务器,因此如果您的队列与 IIS 安装在同一台计算机上,则这确实应该是 localhost。
The URI of your service endpoint must match (more or less, cf http://msdn.microsoft.com/en-us/library/ms789042.aspx) the queue name. So here, the solution would be to create a virtual directory named staging and put your service there.
As for the binding info, localhost points to the server was queue listener shoudl be listen at so if your queues are installed on the same machine as IIS, this shoumld indeed be localhost.
还有一个有趣的点:net.msmq listner 适配器服务似乎缓存了它无法访问队列的事实。如果它尝试访问您的服务的队列并失败,然后您为 net.msmq 侦听器适配器添加权限,它仍然无法工作。我重新启动了服务,然后队列又开始被监视。
Also an interesting point: The net.msmq listner adapter service seems to cache the fact that it couldn't access the queue. If it attempts to access a queue for your service and fails, and then you add permission for the net.msmq listener adapter, it still won't work. I restarted the service and then the queue started being watched again.