activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Gomes (JIRA)" <jira+amq...@apache.org>
Subject [jira] Resolved: (AMQNET-168) NPE with AutoAcknowledge mode
Date Wed, 26 Aug 2009 01:23:50 GMT

     [ https://issues.apache.org/activemq/browse/AMQNET-168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jim Gomes resolved AMQNET-168.
------------------------------

    Resolution: Fixed

> 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.0
>            Reporter: Achmedzhanov Nail
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.2.0
>
>
> 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