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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:44:08+00:00 2026-06-10T20:44:08+00:00

I am new to NServiceBus and am trying to develop a publisher and separate

  • 0

I am new to NServiceBus and am trying to develop a publisher and separate subscriber (I’m using v3.2.0.0) which, so far, is sort of working ok – both the publisher and subscriber are running in NServiceBus Host. My messages all publish ok but intermittently they do not get picked up by the subscriber, with the following error being displayed by the publisher:

2012-09-05 14:27:37,491 [Worker.6] WARN  NServiceBus.Unicast.UnicastBus [(null)]  <(null)> - No handlers could be found for message type: MyNamespace.MyMessage

This warning doesn’t appear for all messages though, so if I keep publishing message after message I might see half of them displaying the message and therefore not being picked up by the subscriber, although all are appearing in the MSMQ queue.

I’ll admit I’m struggling to get to grips with this, so some of my code so far may well be complete rubbish!

I am publishing messages to NSB as follows, with the message input being one of several different types I have defined:

private void Publish<T>(T message)
{
    var myBus = Configure.Instance.Builder.Build<IBus>();
    myBus.Publish(message);
}

The EndpointConfig of the publisher is as follows:

[EndpointName("MyQueue")]
public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, IWantCustomInitialization
{
    /// <summary>
    /// Initialisation for NServiceBus.
    /// </summary>
    public void Init()
    {
        Configure.With()
            .DefaultBuilder()
            .MsmqSubscriptionStorage()
            .DisableTimeoutManager()
            .DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("MyNamespace"));
    }
}

On the subscriber side I have the following EndpointConfig:

[EndpointName("MyQueue")]
public class EndPointConfig : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization
{
    public void Init()
    {
        Configure.With()
            .DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("MyNamespace"));
    }
}

With an EventMessageHandler as follows:

public class EventMessageHandler : IEvent, IHandleMessages<IMyMessage>
{
    public void Handle(IMyMessage message)
    {
        Console.WriteLine(string.Format("Subscriber 1 received EventMessage with Id {0}.", message.Id));
    }
}

The subscriber’s app.config is:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
    <section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
  </configSections>

  <MessageForwardingInCaseOfFaultConfig ErrorQueue="error"/>

  <UnicastBusConfig>
    <MessageEndpointMappings>
      <add Messages="MyNamespace" Endpoint="MyQueue" />
    </MessageEndpointMappings>
  </UnicastBusConfig>
</configuration>
  • 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-06-10T20:44:09+00:00Added an answer on June 10, 2026 at 8:44 pm

    It looks like you are using the same endpoint name for both your publisher and your subscriber. NServiceBus uses the endpoint name to generate the queue names, so that means that both processes wind up using the same queue.

    So in effect your publisher is publishing messages, but then the publisher and the subscriber are fighting over who gets to process them.

    When the subscriber wins, you see your intended behavior.

    When the publisher wins, there is no handler for that message, so NServiceBus displays a warning. This isn’t always a problem; there are certain scenarios where you would want to receive and simply ignore a message, but this warning allows you to at least know it’s happening, and in your case, it’s saying that the message isn’t being processed by the intended application.

    So to fix it, simply change the endpoint names. MySubscriber and MyPublisher, or something like that.

    You don’t even need to use that attribute, you can just name the class that implements IConfigureThisEndpoint and NServiceBus will construct the endpoint name based on that. You can even use underscores such as MyProject_MyPublisher : IConfigureThisEndpoint and NServiceBus will turn the underscores into dots, so you’ll get an input queue of “MyProject.MyPublisher” which is really nice for namespacing when you have many endpoints running around.

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

Sidebar

Related Questions

Im trying to create a really basic NServicebus.Host application which sends a message every
I am very new to nservicebus. I am using version 3.0.1, the last one
I am new to NServiceBus and struggling to inject IBus in my controller using
I have a NServiceBus 3.0 publisher which runs under a domain service account. The
I'm new to using NServiceBus, so I'm pretty sure I'm just screwing up the
I am trying to nuget the new 3.0 binaries for NServiceBus but they don't
I'm trying to get up and running with my NServiceBus setup. I'm basically trying
How do you integrate to NServiceBus when using NEventStore? I'm new to NSB ans
I start the NServisBus.host.exe file from my wpf application using the following code: System.Diagnostics.Process.Start(NServiceBus.Host.exe);
I'm using NServiceBus to handle some calculation messages. I have a new requirement to

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.