Reg:Windows服务阅读MSMQ [英] Reg : Windows service reading MSMQ

查看:79
本文介绍了Reg:Windows服务阅读MSMQ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我是C#编程的初级用户。


我创建了一个向MSMQ发送一些消息的程序。从MSMQ中,Windows服务将读取消息并对其进行处理。我将收到1000条消息。


当前正在发送消息和阅读消息。但我的问题在于Windows服务。


我已经成功创建了一个Windows服务框架,但是服务的onStart()应该做什么以及如何做以下事情。


  1. 服务将持续检查MSMQ是否有任何消息。
  2. 如果消息到达MSMQ。赢服务会选择它。
  3. 选择它之后,它应该创建一个线程来处理它。因为对于100个用户,我将为每个请求创建单独的线程。
  4. 处理后关闭线程。

我有代码来读取我的队列。但是我不确定Win服务部分。


如果有人之前创建的,你可以分享一些示例代码给我。如果有任何链接,请与我分享。


提前感谢。


baskar k

解决方案

我正在将你的线程转移到  Microsoft消息队列(MSMQ)  专业支持论坛。感谢。

Hi All,

Iam a novice user to C# programming.

Iam creating a program which send some message to MSMQ. From the MSMQ a windows service will read a message and process it. At a time i will receive 1000 message.

currently Sending message and reading message is ok. But my problem is with the windows service.

I have created a windows service skeleton successfully but onStart() of the service what should i have to do and how to do this following things.

  1. Service will check the MSMQ continuiously for any message.
  2. If a message arrives in the MSMQ. Win service will pick it.
  3. After picking it it should create a thread to process it. becos for 100 user i will create seperate thread for each request.
  4. close the thread after process.

I have code to read my queue. but iam not sure of the Win service part.

If anyone has created earlier can you share some sample code to me. If there is any link can you please share it with me.

thanks in advance.

baskar k

解决方案

I am moving your thread into the Microsoft Message Queuing (MSMQ) Forum for specialized support. Thanks.


这篇关于Reg:Windows服务阅读MSMQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆