473,382 Members | 1,437 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Message Queue Question:

Message Queue Question:

I'm trying to make a demo for MSMQ.
I send a message(string) on client and try to receive it in a daemon(Windows
service).
Now, I get a problem:

1. When I start the service in services manager, The start event will be
time out. but in fact, the service is running and in loop "for".
What can I to for this problem.

Thanks

Charles Shao :-)

================================================== ==============
server.OnStart()
{
.....
for(;;)
{
crrMsg = Msmq1.Receive();
GlobalLog.write("Received Message:" + crrMsg.Body.ToString() + "\n" );
}
}// In fact, On start will never return .


Nov 17 '05 #1
1 1282

"Charles Shao" <ad****@263.net> wrote in message
news:ew**************@TK2MSFTNGP12.phx.gbl...
Message Queue Question:

I'm trying to make a demo for MSMQ.
I send a message(string) on client and try to receive it in a
daemon(Windows
service).
Now, I get a problem:

1. When I start the service in services manager, The start event will be
time out. but in fact, the service is running and in loop "for".
What can I to for this problem.

Thanks

Charles Shao :-)

================================================== ==============
server.OnStart()
{
.....
for(;;)
{
crrMsg = Msmq1.Receive();
GlobalLog.write("Received Message:" + crrMsg.Body.ToString() + "\n" );
}
}// In fact, On start will never return .


The problem is that you need to return from OnStart within 30 seconds by
default.
So you need to spawn another thread to do the actual processing.

Willy.
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Flip | last post by:
I've been reading about message queues (ex http://www.devx.com/dotnet/Article/27560) and I thought I had installed the message queue from the IIS install, and I can see it running in Services, but...
2
by: Rodrigo GarcĂ­a | last post by:
Hi. The problem is a bit hard to explain. I have a ServicedComponent method which runs a distributed transaction consisting on a a MessageQueue reception and several database operations. That...
2
by: Gvs | last post by:
Hi, I'm currently trying to pass messages into a queue. This all works fine, however, i'm trying to my program to stop sending messages to the queue when it reaches an upper threshold. At...
0
by: Kimmo Laine | last post by:
Hi, i have the a test app ( Sender ) with 3 buttons: first will open/create queue, second will send the message and third will close the queue. Here is the code private void...
3
by: Brian Keating EI9FXB | last post by:
Hello again, I've already placed a few posts on this topic. This time i've a simple application that exhibits my problem, I've placed sample solution 8k on my website should anyone be interested...
0
by: Marcus | last post by:
Hello All, I am trying to create a private MSMQ message queue on a remote application server from an asp.net application using the following code: Dim queue As MessageQueue queue =...
19
by: ern | last post by:
I need a FIFO queue of size 20, to keep track of a running average. Once the queue is full with 20 values, I want to take the sum/20 = AVERAGE. Then when a new value comes in, I want: (Old Sum...
6
by: les | last post by:
Here's a class which uses 2.0 generics to implement an inter-thread message queue in C#. Any number of threads can post and read from the queue simultaneously, and the message object can be any...
1
by: Andrew Robert | last post by:
Hi everyone, Could someone help explain what I am doing wrong in this code block? This code block is an excerpt from a larger file that receives transmitted files via IBM WebSphere MQSeries...
3
by: Ahmad Jalil Qarshi | last post by:
Hi, I have developed an application in C on IBM AIX 5.2. Its using multiple Message Queues to share data between different processes. I am using following functions to send/receive messages...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.