Description
A'm using NMS.MSMQ for to produce messages to MSMQ
If i create session with AcknowledgementMode.AutoAcknowledge it throws NullPointerException at Dispose Method
Code
==================================================================
using (var connection = connectionFactory.CreateConnection())
{
using (var session = connection.CreateSession(AcknowledgementMode.Transactional))
{
var destination = SessionUtil.GetDestination(session, mailQueue);
using (IMessageProducer producer = session.CreateProducer())
{ producer.DeliveryMode = MsgDeliveryMode.Persistent; var request = session.CreateBytesMessage(Encoding.UTF8.GetBytes(serialized)); request.NMSType = "Test"; producer.Send(request, MsgDeliveryMode.Persistent, MsgPriority.Normal, TimeSpan.Zero); } } // throws exception
}
==================================================================
Problem is here
==================================================================
public MessageQueueTransaction MessageQueueTransaction
{
get
set
{ messageQueueTransaction = value; }}
==================================================================