Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 67420 invoked from network); 5 Dec 2008 10:52:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2008 10:52:27 -0000 Received: (qmail 72326 invoked by uid 500); 5 Dec 2008 10:52:39 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 72291 invoked by uid 500); 5 Dec 2008 10:52:38 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 72280 invoked by uid 99); 5 Dec 2008 10:52:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Dec 2008 02:52:38 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Dec 2008 10:51:17 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A675E234C317 for ; Fri, 5 Dec 2008 02:52:05 -0800 (PST) Message-ID: <1580582729.1228474325680.JavaMail.jira@brutus> Date: Fri, 5 Dec 2008 02:52:05 -0800 (PST) From: "Sanjeev (JIRA)" To: dev@activemq.apache.org Subject: [jira] Commented: (AMQNET-131) .NET Client is not receiving messages In-Reply-To: <380933905.1228370885386.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQNET-131?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 47879#action_47879 ]=20 Sanjeev commented on AMQNET-131: -------------------------------- Jim, I tried as suggested. But this is also not working. It is not picking messa= ges at all. It is not throwing any exception also. The code is modified as= below Private Sub OpenConnections() Try ListenLocationQueueMessaage() ListenMeterQueueMessaage() ListenWOQueueMessaage() 'Starting Connections locConnection.Start() mtrConnection.Start() woConnection.Start() =20 LogMessage("Connections Started.") Catch ex As Exception LogMessage(ex.Message) End Try End Sub When I tried to run on the following environment it is working fine DEV Environment 1. .NET Producer on Windows XP/2003 server 2. ActiveMQ on JBoss Web server on Windows 2003 Server (ActiveMQ 4.1/5.1, = JBOSS 4.2.2)=20 3. .NET Consumer on Windows XP/2003 server I ran it for one day continuously, consumer is getting messages even after = one day without any restart. No issues found in this environment. But, when I tried to run the same code on the following environment ST Environment 1. Java Producer using Mule, is placing Messages into Queue. 2. ActiveMQ on JBoss web server, running on Linux (ActiveMQ 4.1/5.1, JBOSS= 4.2.2)=20 3. .NET Consumer running as Windows Service on Windows 2003 server It is listening to messages only at the time of starting service. It is not= getting messages after some time. But there are messages in the queue. Aft= er sometime, we had to restart the service. Sometimes we had to restart 2 t= o 3 times. The issue is observed sporadically in ST environment. Scenario Tested 1. Start the .NET Consumer. 2. Java producer places messages into queue. 3. Consumer picking the messages well. 4. Wait for one hour and place messages into queue again. 5. Consumer is not getting messages this time. I tried different coding options for this 1. Using SimpleMessageContainer. 2. Using Consumer.ReceiveNoWait(). 3. Using Exception Handler with IConnection. 4. Opening and closing connections at regular intervals of time. All of these seem to be working well on Dev Environment, but none of them a= re working on ST environment. Kindly suggest.=20 Issue Summary:=20 .NET client is not able to receive messages from ActiveMQ after some time. = We need to restart the service when it gets stuck. Sometimes even restartin= g the service does not work. No errors get logged. The issue is observed sporadically in: =E2=80=A2 Consumer on Windows 2003 server and Producer and ActiveMQ o= n Linux =20 Strangely, the issue has NOT been observed in the following environments. T= hese envs imply producer on Windows=20 =E2=80=A2 .NET Listener running on Windows 2003 Server and JBoss Act= iveMQ on Windows 2003 Server =E2=80=A2 .NET Listener running on Windows XP and JBoss ActiveMQ on = Windows 2003 Server=20 =20 =20 Options Tried (without success): =E2=80=A2 Option 1: .NET client is deployed as windows service. Eve= nts are registered to the queues to notify the client whenever a message ar= rives into=20 queue. =E2=80=A2 Option 2: .NET client is deployed as windows service. Pol= ling the queues explicitly at regular intervals of time to pull the message= s from queue using Consumer.ReceiveNoWait() Thanks, Sanjeev. > .NET Client is not receiving messages > ------------------------------------- > > Key: AMQNET-131 > URL: https://issues.apache.org/activemq/browse/AMQNET-131 > Project: ActiveMQ .Net > Issue Type: Bug > Components: ActiveMQ Client > Environment: 1. Java Producer using Mule placing Messages into Qu= eue. > 2. ActiveMQ on JBoss web server, running on Linux=20 > 3. .NET Consumer running as Windows Service on Windows 2003 server > Reporter: Sanjeev > Assignee: Jim Gomes > Priority: Critical > > I am using IMessageConsumer to receive messages from the queue using NMS = on .NET. > The listener is dying periodically within half-hour. I could see message= s in the queue. But .NET Listener is not getting any messages. > The messages are arriving after I restart the service.=20 > Please find below the code I am using > Imports System > Imports System.Collections.Generic > Imports System.Text > Imports System.Configuration > Imports System.Threading > Imports ActiveMQ > Imports Spring.Messaging.Nms > Imports Spring.Messaging.Nms.Listener > Imports Business.RIO.Business > Imports BusinessEntities.RIO.Entities > Imports Exceptions.RMSExceptions > Imports Utils.RIO.Utils > Imports NMS > Imports System.Xml > Imports System.Timers > Namespace ListenerConsole > Public Class InterfaceBaseHelper > #Region "Private Variables" > Private config As ConfigurationEntity > #End Region > Public Sub New() > config =3D New ConfigurationEntity() > config.ServerName =3D ConfigurationManager.AppSettings("Serve= rName") > config.LocationQueueName =3D ConfigurationManager.AppSettings= ("LocationQueueName") > config.CustQueueName =3D ConfigurationManager.AppSettings("Cu= stomerQueueName") > config.WOQueueName =3D ConfigurationManager.AppSettings("WOQu= eueName") > config.MeterQueueName =3D ConfigurationManager.AppSettings("M= eterQueueName") > config.InfraQueueName =3D ConfigurationManager.AppSettings("I= nfraQueueName") > config.LocationAckQueueName =3D ConfigurationManager.AppSetti= ngs("LocationAcknowledgementQueueName") > config.MeterAckQueueName =3D ConfigurationManager.AppSettings= ("MeterAcknowledgementQueueName") > config.WOAckQueueName =3D ConfigurationManager.AppSettings("W= OAcknowledgementQueueName") > config.InfraAckQueueName =3D ConfigurationManager.AppSettings= ("InfraAcknowledgementQueueName") > config.CustAckQueueName =3D ConfigurationManager.AppSettings(= "CustAcknowledgementQueueName") > config.ErrorQueueName =3D ConfigurationManager.AppSettings("E= rrorQueueName") > config.ServerPollingIntervalInSeconds =3D Convert.ToInt32(Con= figurationManager.AppSettings("ServerConnectionPollingIntervalInSeconds")) > facade =3D New RIOFacade(config) > End Sub > Dim timer As System.Timers.Timer > Dim facade As RIOFacade > ''' > ''' Starts all queues > ''' > ''' > Public Sub ServiceStartUp() > Try > timer =3D New System.Timers.Timer() > timer.Interval =3D config.ServerPollingIntervalInSeconds = * 1000 > timer.Enabled =3D True > OpenConnections() > AddHandler timer.Elapsed, (AddressOf StartConnections) > timer.Start() > Catch ex As Exception > ExceptionManager.HandleException(ex) > RIOHelper.LogException(ex) > End Try > End Sub > Dim lookupsCached As Boolean =3D False > Private Sub OpenConnections() > Try > =20 > ListenLocationQueueMessaage() > ListenMeterQueueMessaage() > ListeninfraQueueMessaage() > ListenWOQueueMessaage() > RIOHelper.LogMessage("Connections Started.") > Catch ex As Exception > RIOHelper.LogMessage(ex.Message) > ExceptionManager.HandleException(ex) > End Try > End Sub > Private Sub StartConnections(ByVal sender As Object, ByVal e As E= lapsedEventArgs) > Try > timer.Stop() > CloseConnections() > OpenConnections() > Catch ex As Exception > RIOHelper.LogMessage(ex.Message) > ExceptionManager.HandleException(ex) > End Try > timer.Start() > End Sub > Private Sub CloseConnections() > locConnectionFactory =3D Nothing > locConsumer.Close() > locConsumer.Dispose() > locSession.Close() > locSession.Dispose() > locConnection.Close() > locConnection.Dispose() > mtrConnectionFactory =3D Nothing > mtrConsumer.Close() > mtrConsumer.Dispose() > mtrSession.Close() > mtrSession.Dispose() > mtrConnection.Close() > mtrConnection.Dispose() > woConnectionFactory =3D Nothing > woConsumer.Close() > woConsumer.Dispose() > woSession.Close() > woSession.Dispose() > woConnection.Close() > woConnection.Dispose() > infraConnectionFactory =3D Nothing > infraConsumer.Close() > infraConsumer.Dispose() > infraSession.Close() > infraSession.Dispose() > infraConnection.Close() > infraConnection.Dispose() > End Sub > #Region "Listerners" > Dim locConnectionFactory As ConnectionFactory > Dim locConnection As IConnection > Dim locSession As ISession > Dim locConsumer As IMessageConsumer > ''' > ''' Listener for Location queue > ''' > ''' > Private Sub ListenLocationQueueMessaage() > locConnectionFactory =3D New ConnectionFactory(config.ServerN= ame) > locConnection =3D locConnectionFactory.CreateConnection() > locSession =3D locConnection.CreateSession() > locConsumer =3D locSession.CreateConsumer(locSession.GetQueue= (config.LocationQueueName)) > AddHandler locConsumer.Listener, (AddressOf HandleLocation) > End Sub > Private Sub HandleLocation(ByVal message As IMessage) > facade.ProcessLocation(TryCast(message, ITextMessage).Text) > End Sub > Dim mtrConnectionFactory As ConnectionFactory > Dim mtrConnection As IConnection > Dim mtrSession As ISession > Dim mtrConsumer As IMessageConsumer > ''' > ''' Listener for Meter queue > ''' > ''' > Private Sub ListenMeterQueueMessaage() > mtrConnectionFactory =3D New ConnectionFactory(config.ServerN= ame) > mtrConnection =3D mtrConnectionFactory.CreateConnection() > mtrSession =3D mtrConnection.CreateSession() > mtrConsumer =3D mtrSession.CreateConsumer(mtrSession.GetQueue= (config.MeterQueueName)) > AddHandler mtrConsumer.Listener, (AddressOf HandleMeter) > End Sub > Private Sub HandleMeter(ByVal message As IMessage) > facade.ProcessMeter(TryCast(message, ITextMessage).Text) > End Sub > Dim woConnectionFactory As ConnectionFactory > Dim woConnection As IConnection > Dim woSession As ISession > Dim woConsumer As IMessageConsumer > ''' > ''' Listener for WorkOrder queue > ''' > ''' > Private Sub ListenWOQueueMessaage() > woConnectionFactory =3D New ConnectionFactory(config.ServerNa= me) > woConnection =3D woConnectionFactory.CreateConnection() > woSession =3D woConnection.CreateSession() > woConsumer =3D woSession.CreateConsumer(woSession.GetQueue(co= nfig.WOQueueName)) > AddHandler woConsumer.Listener, (AddressOf HandleWO) > End Sub > Private Sub HandleWO(ByVal message As IMessage) > facade.ProcessWO(TryCast(message, ITextMessage).Text) > End Sub > Dim infraConnectionFactory As ConnectionFactory > Dim infraConnection As IConnection > Dim infraSession As ISession > Dim infraConsumer As IMessageConsumer > ''' > ''' Listener for Infra queue > ''' > ''' > Private Sub ListeninfraQueueMessaage() > infraConnectionFactory =3D New ConnectionFactory(config.Serve= rName) > infraConnection =3D infraConnectionFactory.CreateConnection() > infraSession =3D infraConnection.CreateSession() > infraConsumer =3D infraSession.CreateConsumer(infraSession.Ge= tQueue(config.InfraQueueName)) > AddHandler infraConsumer.Listener, (AddressOf HandleInfra) > End Sub > Private Sub HandleInfra(ByVal message As IMessage) > facade.ProcessInfra(TryCast(message, ITextMessage).Text) > End Sub > #End Region > End Class > End Namespace --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.