My NServiceBus is throwing a warning that it received an empty message and hence ignoring it. But the message is indeed not empty.
My bus configuration
Configure.With()
.Log4Net()
.DefaultBuilder()
.XmlSerializer()
.RavenSubscriptionStorage()
.MsmqTransport()
.IsTransactional(true)
.PurgeOnStartup(false)
.UnicastBus();
Here is the message. The xml is correct(I mean that the values and tags of the xml are correct compared to the object that I sent).
<Messages>
<Class1>
<Class2>
<QueueAddress>.\\private$\\myerrorqueue</QueueAddress>
<Category>Some string here</Category>
<ExtraInfo> </ExtraInfo>
<Priority> 1 </Priority>
<LookupValue> 1 </LookupValue>
</Class2>
</Class1>
</Messages>
The warning
2014-06-24 15:45:42,213 [Worker.14] WARN NServiceBus.Unicast.UnicastBus [(null)
] - Received an empty message - ignoring.
I know that deserialization is not possible if there are only readonly properties. My interface doesn't have readonly properties.
public interface ISomeInterfaceImplementedByClass1
{
Class2 class2{ get; set; }
}
As mentioned in NServiceBus - Server is throwing empty message warning to the console, I made sure to have same configuration for the bus at sender and receiver side but still the problem exists.
What might be the cause?
UPDATE: If I use JSONSerializer then appropriate handler is being invoked. So it doesn't work with XMLSerializer.