Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 126119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:16:01+00:00 2026-05-11T05:16:01+00:00

I am currently building two windows services: The first takes messages from an internet

  • 0

I am currently building two windows services:

  • The first takes messages from an internet connection and inserts these into a database. This is designed to be fast and stable and not do any other processing

  • The second performs a batch process with any new messages that have arrived since it last ran.

I am trying to think of a way so that the second service will only run its batch process when new messages are ready to be processed and if the second service errors the first service will keep going and vice versa. At the moment it uses a loop every 5 seconds.

I am currently thinking of using a message queue, where the first service writes a message only if the queue is empty, and the second service will see if the queue contains any messages, if not go into an asynchronous wait until a message arrives and then remove the message and run. Therefore using the queue not really as a queue but as a binary switch that when it’s state changes causes an event to be triggered to the second service.

I presume there is a better way to do this that I have not encountered could someone please point me in the right direction?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:16:02+00:00Added an answer on May 11, 2026 at 5:16 am

    Actually, your way is EXACTLY how I would implement this for these results. With MSMQ, you don’t have to check to see if you have a message written to the queue, the first service just writes to the queue, and the second service just reads from it to process it (when it is active).

    The beauty of using MSMQ is that one or the other service can be down, but the queues will be up, so you can continue processing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 243k
  • Answers 243k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer ImageView img = (ImageView) findViewById(R.id.myImageId); img.setOnClickListener(new OnClickListener() { public void… May 13, 2026 at 7:46 am
  • Editorial Team
    Editorial Team added an answer You need to put them both in some container element… May 13, 2026 at 7:46 am
  • Editorial Team
    Editorial Team added an answer What operating system are you dealing with? If it is… May 13, 2026 at 7:46 am

Related Questions

As a follow-up to my recent question about .NET Compact Framework debugging, I am
this question is similar to my previous hover question ( converting css hover to
I am currently building my Core Data model, which I would like to sync
With reference to this programming game I am currently building. alt text http://img12.imageshack.us/img12/2089/shapetransformationf.jpg To

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.