Skip to content

What does not round-trip through NServiceBus

Note

NServiceBus licensing. NServiceBus is dual-licensed: the Reciprocal Public License 1.5, or Particular Software's commercial agreement (particular.net/LicenseAgreement). This format was captured from NServiceBus 10.2.9, and only the module's own .NET test programs use it. The Go module itself does not depend on NServiceBus.

Every other field of an event this format wrote reads back exactly, with nothing in Foreign. That includes an ID that is not a UUID and a payload that is not JSON. These are the exceptions.

Between Go and Go

Event Reads back as Why
Time with nanoseconds Truncated to a microsecond TimeSent has six digits. A time already on a microsecond is kept exactly.
Type containing ; The text before the first ;, in v0.1.0. From the next release Encode refuses it (envelope-nservicebus!4) ; separates entries in EnclosedMessageTypes.
SpecVersion empty 1.0 The format fills it in.

Between Go and .NET

Direction What differs
Go to .NET Time is written in UTC, to the microsecond.
Go to .NET Subject and DataSchema are headers named ce-.... A handler that does not look for them does not see them.
.NET to Go Type is whatever NServiceBus sent, which is the assembly-qualified name, with the assembly, version and culture.
.NET to Go The types a message implements, after the first, are in Foreign.Headers["NServiceBus.EnclosedMessageTypes"] as the whole header value.
.NET to Go NServiceBus's conversation, correlation, intent, machine and version headers are Foreign, and are not sent back.
.NET to Go A producer's header with a capital, such as Tenant, is foreign. A lower-case one is an extension.
.NET to Go A second value of a header is dropped for an extension, and kept for foreign.
.NET to Go TimeSent is read to the microsecond.

What no event can carry

The format writes the headers above and nothing else. A Go service cannot set a correlation ID, a conversation ID, a message intent, or a reply-to address on a message it sends. Correlation is the transport's job in this design, and the foreign bag is read-only.

A case to be aware of

A header that is an extension name but holds an empty string, or a control character, makes the whole message fail validation on read, with the partial event returned.