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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:47:21+00:00 2026-06-02T06:47:21+00:00

When creating a NServiceBus SendOnly endpoint, the purpose is to just fire-and-forget, i.e. just

  • 0

When creating a NServiceBus SendOnly endpoint, the purpose is to just fire-and-forget, i.e. just send a message and then someone else will take care of it. Which seems like the thing I need. I dont want any communication between the bus and the system handling messages. System “A” wants to notify system “B” about something.

Well the creation of an SendOnly endpoint if very straightforward but what about the system listening for messages from an SendOnly endpoint.

I’m trying to set up a listener in a commandline project that will handle messages. The messages get sent to the queue but they doesnt get handled by system “B”.

Is this the wrong approach? Is a bus overkill for this type of functionality?

System A:

public class Program
{
    static void Main(string[] args)
    {
        var container = new UnityContainer();

        var bus = Configure.With()
            .UnityBuilder(container)
            .JsonSerializer()
            .Log4Net()
            .MsmqTransport()
            .UnicastBus()
            .SendOnly();

        while(true)
        {
            Console.WriteLine("Send a message");
            var message = new Message(Console.ReadLine());
            bus.Send(message);
        }
    }
}

System B:

class Program
{
    static void Main(string[] args)
    {
        var container = new UnityContainer();

        var bus = Configure.With()
            .UnityBuilder(container)
            .JsonSerializer()
            .Log4Net()
            .MsmqTransport()
            .UnicastBus()
            .LoadMessageHandlers()
            .CreateBus()
            .Start();

        Console.WriteLine("Waiting for messages...");

        while(true)
        {

        }
    }
}

public class MessageHandler : IHandleMessages<Message>
{
    public void Handle(Message message)
    {
        Console.WriteLine(message.Data);
    }
}

public class Message : IMessage
{
    public Message()
    {

    }

    public Message(string data)
    {
        Data = data;
    }

    public string Data { get; set; }
} 
  • 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-02T06:47:23+00:00Added an answer on June 2, 2026 at 6:47 am

    In the MessageEndpointMappings you need to update it as follows:

    1. Replace DLL with the name of the assembly containing your messages (e.g. “Messages”)
    2. Change the Endpoint to the name of the queue which System B is reading from (You can check the queue name by looking in the MSMQ snapin under private queues).
    <add Messages="Messages" Endpoint="SystemB" />
    

    NServiceBus 3 automatically creates the queue name based upon the namespace of the hosting assembly.

    Additionally, you may want to look at using the NServiceBus.Host to host your handlers instead of your own console application.

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

Sidebar

Related Questions

I am creating a web application that is going to send messages using NServiceBus,
Creating a server-side socket will fail if I'm trying to use the same port
When creating a new service in a WCF service project, Visual Studio will automatically
Creating Trial .git -repo $ mkdir Test; cd Test; git init $ echo Just
Creating a table without tbody using javascript createElement/appendChild will not add tbody in Firebug
Several weeks ago I changed my NServiceBus solution do a direct send of the
Are there any reasons not to reuse an NServiceBus message ( IMessage ) in
Creating a zip file using Send To -> Compressed folder excludes .hg folder on
Creating a relatively simple data entry form, and just want to separate certain sections
Creating a voting system just like stackoverflow. Questions like this have been asking several

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.