NServiceBus - Server is throwing empty message warning to the console

有些话、适合烂在心里 提交于 2019-12-11 19:11:58

问题


2013-03-28 10:18:32,374 [Worker.5] 
WARN  NServiceBus.Unicast.UnicastBus [(null)] <(null)> - 
Received an empty message - ignoring.

I have a client that bus.send("server", command) going from an mvc4 website to a message processor. The message processor was setup to be default without any custom initialization.

This is my configuration on the website side in the global.asax

        Configure.With()
            .StructureMapBuilder(container)
            .JsonSerializer()
            .Log4Net()
            .MsmqTransport()
                .IsTransactional(false)
                .PurgeOnStartup(true)
            .UnicastBus()
                .ImpersonateSender(false)
            .CreateBus()
            .Start(() => Configure.Instance.ForInstallationOn<NServiceBus.Installation.Environments.Windows>().Install());         

I reviewed NServicebus publishing event - recieves empty message, but that didn't help, I don't have read only properties.


回答1:


The problem is similar to the linked question in the OP. I found that the serialization methods need to match between the sender and the server. I had to add custom initialization on the server side and add the defaultbuilder as well as the json serializer to match the web side in order for messages to work right.




回答2:


One other thing which I found was, I was using IWantCustomInitialization with below configuration:

Configure.With(typeof(TransactionDetailsHandler).Assembly) // this is problematic one
                .CastleWindsorBuilder(container)
                .DefaultBuilder();

I didn't specify assembly type of my message in Configure. With adding that resolved the problem.



来源:https://stackoverflow.com/questions/15685797/nservicebus-server-is-throwing-empty-message-warning-to-the-console

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!