NPE with AutoAcknowledge mode
-----------------------------

                 Key: AMQNET-168
                 URL: https://issues.apache.org/activemq/browse/AMQNET-168
             Project: ActiveMQ .Net
          Issue Type: Bug
          Components: MSMQ
    Affects Versions: 1.2
            Reporter: Achmedzhanov Nail
            Assignee: Jim Gomes
            Priority: Critical
             Fix For: 1.2


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
                        {
                                
//----------------------------------------------------------------------------------------
                                // messageQueueTransaction is null with  
AutoAcknowledge mode
                                
//----------------------------------------------------------------------------------------
                                if(messageQueueTransaction.Status != 
MessageQueueTransactionStatus.Pending)
                                        messageQueueTransaction.Begin();
                                return messageQueueTransaction;
                        }
                        set { messageQueueTransaction = value; }
                }

==================================================================


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to