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

  • SEARCH
  • Home
  • 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 3459916
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:09:57+00:00 2026-05-18T10:09:57+00:00

I am working through the first steps of figuring out Nservicebus and planning a

  • 0

I am working through the first steps of figuring out Nservicebus and planning a reasonably large scale (at least for me) app.

I want the app to be able to scale out onto X machines. It will have a number of services, such as:

LogonService
UserManagementService
GameService
RoomService
etc…

The clients would talk to the server through WCF. The services themselves would talk to each other via NServiceBus and MSMQ. Sacha Barber has written an excellent article on getting started with NServiceBus and has come up against the same situation I am going to hit. There is a further chat between Udi and Sacha about this here.

My Question is, when a service is handling a message how does it know about the rest of the app in that service? As Sacha puts it, “a handler will automagically” appear when a message needs dealing with. So when this is created how does it know about the other objects that are already up and running. For example in the GameService, it would have a list of all games currently running. How would it access this?

I guess the two options that I can think of, (as Sacha pointed out), are:

Mediator pattern
Singleton

Out of the two I think I would rather register a singleton with Castle Windsor and use it that way.

Is this an appropriate use of the Singleton pattern, (as you often see people referring to the Singleton as the “Devil”, I don’t want to miss use it if possible).

Is there a better solution to this problem?

Thanks

  • 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. Editorial Team
    Editorial Team
    2026-05-18T10:09:58+00:00Added an answer on May 18, 2026 at 10:09 am

    For state that need to be kept in memory I would also use the Singleton pattern. Otherwise state is usually maintained in the datastore and read by the handler for each message proceed.

    public Handle(SomeMessage msg)
    {
       var aggregateRoot = writeStore.Get(msg.SomeId);
    
       aggregate.DoSomeAction(msg.SomeOtherData);
    
       //if write store does not support dirty tracking
       writeStore.Save(aggregateRoot);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working through the Stanford iPhone podcasts and have some basic questions. The first:
I am currently working on a large scale application project (written in c++) which
I'm working though the First Steps tutorial on the POCO Project site, and I've
I finished first year comp sci. And i want to spend some time working
I'm taking my first steps through Unity, as a follow up to this question:
I am working through head first jquery and I am on a chapter dealing
Still working through JQuery to get data and repopulate portions of a page. Right
In working through the issues with another question, I've found text files with embedded
I am working through the EditableGrid demos modifying the code to understand it and
I'm working through some android tutorials right now in preparation for a two week

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.