Thomas
Thomas

Reputation: 595

NServicebus Nhibernate Exception on sending message

When we send a message through NServiceBus containing a full exception stacktrace we get the following NHibernate exception:

    Z Error dehydrating property value for 
NServiceBus.TimeoutPersisters.NHibernate.TimeoutEntity.Headers NHibernate.PropertyValueException NHibernate.HibernateException NServiceBus.Core 
at NServiceBus.Unicast.Transport.Transactional.TransactionalTransport.ProcessMessage(TransportMessage m) 
at NServiceBus.Unicast.Transport.Transactional.TransactionalTransport.ReceiveMessage() 
at NServiceBus.Utils.TransactionWrapper.RunInTransaction(Action callback, IsolationLevel isolationLevel, TimeSpan transactionTimeout) 
at NServiceBus.Unicast.Transport.Transactional.TransactionalTransport.Process() 

It has something to do with the length of the message field, but it seems like it's an internal NServiceBus issue. We use NServiceBus v3.2.4

The message class looks like this:

public class ExceptionOccuredCommand : ICommand
    {
        public string Message { get; set; }
        public string Details { get; set; }
        public DateTime ExceptionDate { get; set; }
        public string UserName { get; set; }
        public string MachineName { get; set; }
        public string ApplicationName { get; set; }

        public string ErrorQueue { get; set; }
        //public string SourceQueue { get; set; }
        public string MessageId { get; set; }
    }

How can this be fixed?

Upvotes: 0

Views: 416

Answers (1)

Andreas Öhlund
Andreas Öhlund

Reputation: 5273

There is a hard limit on 4000 characters for the headers and you seems to be hitting that limit. I've opened up an issue for this on our issues list: https://github.com/NServiceBus/NServiceBus/issues/737

Upvotes: 1

Related Questions