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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:31:12+00:00 2026-05-24T02:31:12+00:00

I keep recieving the following message from my denormalizer host after publishing an event

  • 0

I keep recieving the following message from my denormalizer host after publishing an event in my domain:

2011-07-22 14:18:32,374 [Worker.5] WARN  NServiceBus.Unicast.UnicastBus [(null)]
 <(null)> - Received an empty message - ignoring.

I am just doing this with jolivers eventstore:

return Wireup.Init()
                .UsingRavenPersistence("EventStore", new DocumentObjectSerializer())
                .UsingAsynchronousDispatcher()
                .PublishTo(new DelegateMessagePublisher(c => container.Resolve<IPublishMessages>().Publish(c)))
                .Build();

IPublishMessages resolves to :

 public sealed class NServiceBusPublisher : IPublishMessages
{
    private const string AggregateIdKey = "AggregateId";
    private const string CommitVersionKey = "CommitVersion";
    private const string EventVersionKey = "EventVersion";
    private const string BusPrefixKey = "Bus.";
    private readonly IBus bus;

    public NServiceBusPublisher(IBus bus)
    {
        this.bus = bus;
    }

    public void Dispose()
    {
        GC.SuppressFinalize(this);
    }

    public void Publish(Commit commit)
    {
        for (var i = 0; i < commit.Events.Count; i++)
        {
            var eventMessage = commit.Events[i];
            var busMessage = eventMessage.Body as IMessage;
            AppendHeaders(busMessage, commit.Headers); // optional
            AppendHeaders(busMessage, eventMessage.Headers); // optional
            AppendVersion(commit, i); // optional
            this.bus.Publish(busMessage);
        }
    }
    private static void AppendHeaders(IMessage message, IEnumerable<KeyValuePair<string, object>> headers)
    {
        headers = headers.Where(x => x.Key.StartsWith(BusPrefixKey));
        foreach (var header in headers)
        {
            var key = header.Key.Substring(BusPrefixKey.Length);
            var value = (header.Value ?? string.Empty).ToString();
            message.SetHeader(key, value);
        }
    }
    private static void AppendVersion(Commit commit, int index)
    {
        var busMessage = commit.Events[index].Body as IMessage;
        busMessage.SetHeader(AggregateIdKey, commit.StreamId.ToString());
        busMessage.SetHeader(CommitVersionKey, commit.StreamRevision.ToString());
        busMessage.SetHeader(EventVersionKey, GetSpecificEventVersion(commit, index).ToString());
    }
    private static int GetSpecificEventVersion(Commit commit, int index)
    {
        // e.g. (StreamRevision: 120) - (5 events) + 1 + (index @ 4: the last index) = event version: 120
        return commit.StreamRevision - commit.Events.Count + 1 + index;
    }
}

The NServiceBus host that is publishing the events has the following config:

    <MsmqTransportConfig
    InputQueue="SonatribeInputQueue"
    ErrorQueue="error"
    NumberOfWorkerThreads="1"
    MaxRetries="5"
    />

  <UnicastBusConfig
     DistributorControlAddress=""
     DistributorDataAddress=""
     ForwardReceivedMessagesTo="">
    <MessageEndpointMappings>
      <add Messages="Events" Endpoint="SonatribeInputQueue"/>
    </MessageEndpointMappings>
  </UnicastBusConfig>

And the denormalizer host recieving the events is:

 <MsmqTransportConfig
    InputQueue="MyServerInputQueue"
    ErrorQueue="error"
    NumberOfWorkerThreads="1"
    MaxRetries="5"
    />

  <UnicastBusConfig>
    <MessageEndpointMappings>
      <add Messages="Events" Endpoint="SonatribeInputQueue"/>
    </MessageEndpointMappings>
  </UnicastBusConfig>

Which seems about right to me – the publisher processes the command sent from the web and the domain raises the event. the NServiceBusPublisher publishes the event and the denormalizer host at least recieves something! it’s just not the message it had been sent – or something has happened at least for it to think that the message is empty….

Anyone?

*****update***********

I am now getting the following from l4n:

2011-07-22 16:31:30,646 [Worker.7] ERROR NServiceBus.Faults.InMemory.FaultManage
r [(null)] <(null)> - Serialization failed for message with ID 56b7b693-090f-49b
d-83ad-7beeb334fe6d\12639.
System.Security.VerificationException: Operation could destabilize the runtime.
   at SetId(Object , Object )
   at NServiceBus.Serializers.XML.MessageSerializer.GetObjectOfTypeFromNode(Type
 t, XmlNode node) in c:\Dev\NServiceBus\src\impl\Serializers\NServiceBus.Seriali
zers.XML\MessageSerializer.cs:line 343
   at NServiceBus.Serializers.XML.MessageSerializer.Process(XmlNode node, Object
 parent) in c:\Dev\NServiceBus\src\impl\Serializers\NServiceBus.Serializers.XML\
MessageSerializer.cs:line 330
   at NServiceBus.Serializers.XML.MessageSerializer.Deserialize(Stream stream) i
n c:\Dev\NServiceBus\src\impl\Serializers\NServiceBus.Serializers.XML\MessageSer
ializer.cs:line 267
   at NServiceBus.Unicast.UnicastBus.Extract(TransportMessage m) in c:\Dev\NServ
iceBus\src\unicast\NServiceBus.Unicast\UnicastBus.cs:line 851
2011-07-22 16:31:30,908 [Worker.7] WARN  NServiceBus.Unicast.UnicastBus [(null)]
 <(null)> - Received an empty message - ignoring.

Here is the message it is trying to deserialize!!

[Serializable]
public class AccountCreatedEvent : IEvent
{
    public readonly string Id;
    public readonly string Name;

    public AccountCreatedEvent()
    {

    }

    public AccountCreatedEvent(string id, string name)
    {
        this.Id = id;
        this.Name = name;
    }
    public override string ToString()
    {
        return "AccountCreatedEvent - for when you've created an account";
    }
}

not exactly anything hectic…

  • 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-24T02:31:13+00:00Added an answer on May 24, 2026 at 2:31 am

    It is clear why that message cannot be deserialized – you’ve got readonly properties. If you want to have this work, you need to switch to public get/set properties. In order to preserve your intent of not-publicly-changeable properties, here’s an alternative approach:

    [Serializable]
    public class AccountCreatedEvent : IEvent
    {
        public string Id { get; private set; }
        public string Name {get; private set; }
    
        public AccountCreatedEvent(string id, string name)
        {
            this.Id = id;
            this.Name = name;
        }
    
        public override string ToString()
        {
            return "AccountCreatedEvent - for when you've created an account";
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement my own GenericIdentity implementation but keep receiving the following error
I'm at a company, we keep recieviing new codebases from a third party vendor.
Keep getting this error after inserting a subdatasheet into a query and trying to
I keep hearing from associates about grid computing which, from what I can gather,
I want to call the following function from my managed code: short LS_LoadConfig(LS_ID SensorID,LPVARIANT
I'm new to javascript/jquery. I have the following basic code and I keep receiving
I keep receiving the following error when attempting to unmarshall an xml document using
I am trying to make the following recursive function work but keep receiving an
I am having a problem with PutObject on S3, and keep receiving the following
I am receiving the following from a PayPal IPN script. Is it evident from

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.