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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:55:48+00:00 2026-06-10T22:55:48+00:00

Im trying to create a really basic NServicebus.Host application which sends a message every

  • 0

Im trying to create a really basic NServicebus.Host application which sends a message every second. I dont want to use any of the NServiceBus persistance stuff which uses RavenDB (ie timeouts/sagas).

Ive done the following:

public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, AsA_Publisher, IWantCustomInitialization
{
    public void Init()
    {
        Configure.With()
            .DisableTimeoutManager();
    }
}

and

public class MessageSender : IWantToRunWhenTheBusStarts
{
    private readonly IBus _bus;

    public MessageSender(IBus bus)
    {
        _bus = bus;
    }

    public void Run()
    {
        Task.Factory.StartNew(() =>
        {
            while (true)
            {
                _bus.Publish(new MyMessage { Timestamp = DateTime.Now });
                Thread.Sleep(1000);
            }
        });
    }
}

however I get an exception on the publish line:

System.Net.WebException was unhandled by user code
HResult=-2146233079 Message=Unable to connect to the remote server
Source=System StackTrace:
at System.Net.HttpWebRequest.GetResponse()
at Raven.Client.Connection.HttpJsonRequest.ReadStringInternal(Func1
getResponse)
at Raven.Client.Connection.HttpJsonRequest.ReadResponseString()
at Raven.Client.Connection.HttpJsonRequest.ReadResponseJson()
at Raven.Client.Connection.ServerClient.DirectGet(String serverUrl, String key)
at Raven.Client.Connection.ServerClient.<>c__DisplayClass1.<Get>b__0(String
u)
at Raven.Client.Connection.ServerClient.TryOperation[T](Func
2 operation, String operationUrl, Boolean avoidThrowing, T& result)
at Raven.Client.Connection.ServerClient.ExecuteWithReplication[T](String
method, Func2 operation)
at Raven.Client.Connection.ServerClient.Get(String key)
at Raven.Client.Document.DocumentSession.Load[T](String id)
at System.Linq.Enumerable.WhereSelectArrayIterator
2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__14
2.MoveNext()
at System.Linq.Enumerable.d_811.MoveNext()
at System.Collections.Generic.List
1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable
1 source)
at NServiceBus.Unicast.UnicastBus.Publish[T](T[] messages)
at ClassLibrary1.MessageSender.b
_1() in
at System.Threading.Tasks.Task.Execute() InnerException: System.Net.Sockets.SocketException
HResult=-2147467259
Message=No connection could be made because the target machine actively refused it 127.0.0.1:8080
Source=System
ErrorCode=10061
NativeErrorCode=10061
StackTrace:
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress&
address, ConnectSocketState state, IAsyncResult asyncResult,
Exception& exception)

This suggests to me that NServiceBus is still trying to connect to RavenDB.

What else do I need to disable to make this example work?

Why is it even trying to connect to RavenDB for a basic publish?

Note: I have no subscribers yet.

  • 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-10T22:55:49+00:00Added an answer on June 10, 2026 at 10:55 pm

    It looks like NServiceBus also uses RavenDB for subscription storage by default. By specifying an alternate storage mechanism I was able to get this example working.

                .MsmqTransport()
                    .MsmqSubscriptionStorage()
                .DisableTimeoutManager();
    

    and in the app.config

    <configuration>
        <configSections>
            <section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
            <section name="MsmqSubscriptionStorageConfig" type="NServiceBus.Config.MsmqSubscriptionStorageConfig, NServiceBus.Core" />
        </configSections>
        <MessageForwardingInCaseOfFaultConfig ErrorQueue="error" />
        <MsmqSubscriptionStorageConfig Queue="YourQueue" />
    </configuration>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create an Adobe Air Application, or making basic Mobile Apps
this one is really easy. I'm trying to create a Regular Expression that will
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Trying to create Database as follows: USE Master GO IF NOT EXISTS(SELECT [Name] FROM
Trying to create a macro which can be used for print debug messages when
I'm trying to use DQL to create a query between a ManyToMany relation, here
I'm trying to create a really simple Factory Method design pattern example in Java.
I'm trying to create some sort of many-to-one association. The basic premise is a
I am trying to create a function which will load a whole lot of
I am trying to create a timesheet application in MVC 2, but I feel

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.