activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravican09 <ravica...@gmail.com>
Subject NMS Active MQ: Error handling and debuggin in C#
Date Fri, 21 Oct 2016 15:20:53 GMT
Error handling does not work the way we would expect for some reason tester
given  invalid urlQueue for the connectionFactory , the program simply
hangs,

below is the sample code 


 try
                    {
                        var connectionUri = new Uri(ConnectionUri);
                        IConnectionFactory connectionFactory = new
NMSConnectionFactory(connectionUri);
                        Log.Debug(string.Format("NMS Event: Creating
Connection: {0}", connectionUri));
                        _connection =
connectionFactory.CreateConnection(_userName, _password);
                       Log.Debug(string.Format("NMS Event: Created
Connection: {0}", connectionUri));
                        if (_connection.IsStarted == false)
                        {
                            Log.Debug(string.Format("NMS Event: Starting
Connection: {0}", connectionUri));
                            _connection.Start();
                            Log.Debug(string.Format("NMS Event: Started
Connection: {0}", connectionUri));
                        }
                        _connection.ExceptionListener += ExceptionListener;
                        _connection.ConnectionInterruptedListener +=
ConnectionInterruptedListener;
                        _connection.ConnectionResumedListener +=
ConnectionResumedListener;
                    }
                    catch (Exception ex)
                    {
                        Log.Error("Error creating NMS Connection.", ex);
                        throw;
                    }



--
View this message in context: http://activemq.2283324.n4.nabble.com/NMS-Active-MQ-Error-handling-and-debuggin-in-C-tp4668567p4718243.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Mime
View raw message