Reputation: 1401
I have two endpoints, one is NSB 2.5 and publishes messages, and one is NSB 4.7.5. I want to subscribe to the events published by NSB2 in my NSB4 endpoint, however when I add the subscription to the NSB4 endpoint I get the following error in the NSB2 endpoint:
System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at NServiceBus.Serializers.XML.MessageSerializer.Deserialize(Stream stream) in c:\dev\v3\NServiceBus\src\impl\Seri
at NServiceBus.Unicast.Transport.Msmq.MsmqTransport.Extract(Message message) in c:\dev\v3\NServiceBus\src\impl\uni
at NServiceBus.Unicast.Transport.Msmq.MsmqTransport.ReceiveFromQueue() in c:\dev\v3\NServiceBus\src\impl\unicast\N
And the following in my NSB2 error queue:
<?xml version="1.0"?>
<ArrayOfHeaderInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<HeaderInfo>
<Key>NServiceBus.MessageId</Key>
<Value>7ffbe1e3-9b2c-456c-bcb7-a43d011a2389</Value>
</HeaderInfo>
<HeaderInfo>
<Key>NServiceBus.CorrelationId</Key>
<Value>7ffbe1e3-9b2c-456c-bcb7-a43d011a2389</Value>
</HeaderInfo>
<HeaderInfo>
<Key>NServiceBus.OriginatingEndpoint</Key>
<Value>NSB4Client</Value>
</HeaderInfo>
<HeaderInfo>
<Key>$.diagnostics.originating.hostid</Key>
<Value>75e8656bb268f44ded5f2a82b8798e6a</Value>
</HeaderInfo>
<HeaderInfo>
<Key>NServiceBus.MessageIntent</Key>
<Value>Subscribe</Value>
</HeaderInfo>
<HeaderInfo>
<Key>NServiceBus.Version</Key>
<Value>4.7.5</Value>
</HeaderInfo>
<HeaderInfo>
<Key>NServiceBus.TimeSent</Key>
<Value>2015-02-12 17:07:14:158882 Z</Value>
</HeaderInfo>
<HeaderInfo>
<Key>NServiceBus.OriginatingMachine</Key>
<Value>xxx</Value>
</HeaderInfo>
<HeaderInfo>
<Key>NServiceBus.ControlMessage</Key>
<Value>True</Value>
</HeaderInfo>
<HeaderInfo>
<Key>SubscriptionMessageType</Key>
<Value>MyMessages.EventMessage, MyMessages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Value>
</HeaderInfo>
</ArrayOfHeaderInfo>
I'm assuming it is because the headers are incompatible between 4 and 2 in which case I should be able to use a mutator to convert to a compatible format, howeverI tried using a mutator to intercept the outgoing message on the NSB4 endpoint but it doesn't seem to intercept the message (using both IMutateTransportMessages and IMutateMessages)
Update 2015-02-16 It appears that the outgoing mutators for subscriptions was disabled in 4.3 according to https://groups.google.com/forum/#!topic/particularsoftware/XVLQkCouKCk That would explain why my outgoing mutator solution does not work
Upvotes: 0
Views: 145
Reputation: 5273
V2.5 expects the messages to be wrapped in a root node even though there is just one message beeing sent. That setting is off by default in v4.
Turn it on by calling:
Upvotes: 1