activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Achmedzhanov Nail (JIRA)" <jira+amq...@apache.org>
Subject [jira] Created: (AMQNET-168) NPE with AutoAcknowledge mode
Date Mon, 29 Jun 2009 06:50:07 GMT
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.


Mime
View raw message