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 1048981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:32:36+00:00 2026-05-16T16:32:36+00:00

Using the pub/sub sample i managed to get multiple instances of the same console

  • 0

Using the pub/sub sample i managed to get multiple instances of the same console app to read all messages sent from the publisher. What I did whas this:

namespace Subscriber1

{
public class EndpointConfig : IConfigureThisEndpoint, AsA_Server
{
}

public class OverrideInputQueue : IWantCustomInitialization
{
    public void Init()
    {
        Configure
            .Instance
            .Configurer
            .ConfigureComponent<MsmqTransport>(NServiceBus.ObjectBuilder.ComponentCallModelEnum.None)
            .ConfigureProperty(p => p.InputQueue, Guid.NewGuid());


    }
}

}

How do i setup a wpf app to have multiple instances all read notifications from the publisher??

Using the code above doesn’t do it for me because those lines of code will never be hit.

In my wpf app i reference the NServiceBus host, I add this to the windows code behind:

        public Window1()
    {
        InitializeComponent();
        this.Title = App.AppId.ToString();

        var bus = NServiceBus.Configure.With()
                .DefaultBuilder()
                .XmlSerializer()
                .MsmqTransport()
                    .IsTransactional(true)
                    .PurgeOnStartup(false)
                .UnicastBus()
                    .ImpersonateSender(false)
                    .LoadMessageHandlers()
                .CreateBus()
                .Start();
    }

and I put the I “OverrideInputQueue : IWantCustomInitialization”-part in my endpoint config.

But as I said that part never gets hit. The result is that when you start up two instances of the app, they take turns in picking up the message sent from the publisher. I want both instances to receive ALL messages.

What have I missed?

/Johan

  • 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-16T16:32:36+00:00Added an answer on May 16, 2026 at 4:32 pm

    The problem is that IWantCustomInitialization is only relevant when using the NServiceBus.Host.exe process. What you need to do in your initialization code is this:

            var bus = NServiceBus.Configure.With() 
                .DefaultBuilder() 
                .XmlSerializer() 
                .MsmqTransport() 
                    .IsTransactional(true) 
                    .PurgeOnStartup(false) 
                .RunCustomAction( () => Configure.Instance.Configurer.ConfigureProperty<MsmqTransport>(p => p.InputQueue, Guid.NewGuid()) )
                .UnicastBus() 
                    .ImpersonateSender(false) 
                    .LoadMessageHandlers() 
                .CreateBus() 
                .Start(); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to set up pub-sub between 1 publisher and multiple subscribers using
I am using Addy Osmani's pub sub method: var topics = {}; jQuery.Topic =
Using the Redis info command, I am able to get all the stats of
Looking for advice/pro's/con's on using the memory cache servers for pub/sub esp wrt a
We are using a pub-sub model in our WCF application that pretty much follows
I am using the pub / sub jQuery plugin by Peter Higgins. I have
I've been looking at using Redis Pub/Sub as a replacement to RabbitMQ. From my
We have a wcf pub/sub setup using reliable sessions via netTcpBinding and on one
We have been using PollingDuplexHttpBinding for some time to do Pub/Sub messaging. We have
I am using MsmqSubscriptionStorage in a pub/sub scenario and the first message is lost

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.