{"action":"opened","issue":{"url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/400","labels_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/400/labels{/name}","comments_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/400/comments","events_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/400/events","html_url":"https://github.com/EasyNetQ/EasyNetQ/issues/400","id":61060717,"number":400,"title":"EasyNetQ.EasyNetQException: Not connected","user":{"login":"shindai","id":11459517,"avatar_url":"https://avatars.githubusercontent.com/u/11459517?v=3","gravatar_id":"","url":"https://api.github.com/users/shindai","html_url":"https://github.com/shindai","followers_url":"https://api.github.com/users/shindai/followers","following_url":"https://api.github.com/users/shindai/following{/other_user}","gists_url":"https://api.github.com/users/shindai/gists{/gist_id}","starred_url":"https://api.github.com/users/shindai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shindai/subscriptions","organizations_url":"https://api.github.com/users/shindai/orgs","repos_url":"https://api.github.com/users/shindai/repos","events_url":"https://api.github.com/users/shindai/events{/privacy}","received_events_url":"https://api.github.com/users/shindai/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-13T13:10:48Z","updated_at":"2015-03-13T13:10:48Z","closed_at":null,"body":"Hi,\r\n\r\nI have an Windows-Service build with Topshelf, \r\nreplicating messages from any rabbit mq queue source to different any number of rabbit mq exchanges and other targets. If one destination isn't available for a longer time, the application should retry it and should not crash.\r\n\r\nTherefore I used EasyNetQ to handle this error/retry mechanism.\r\nCurrently using // 0.30.2.0 Upgrade to RabbitMQ.Client 3.3.0\r\n\r\nIf the destination is not available, EasyNetQ retries it multiple times\r\nFailed to connect to Broker: 'XXX.XXX.XXX.XXX', Port: XXX VHost: '/'. ExceptionMessage: 'None of the specified endpoints were reachable'\r\nFailed to connected to any Broker. Retrying in 5000 ms\r\n\r\nThis is ok, but after an hour or more,\r\nthere is an exception like this:\r\n\r\nEasyNetQ.EasyNetQException: Not connected\r\n   at EasyNetQ.PersistentConnection.CreateModel() in c:\\Projekte\\EasyNetQ\\Source\\EasyNetQ\\PersistentConnection.cs:line 42\r\n   at EasyNetQ.Producer.PersistentChannel.OpenChannel() in c:\\Projekte\\EasyNetQ\\Source\\EasyNetQ\\Producer\\PersistentChannel.cs:line 74\r\n   at EasyNetQ.Producer.PersistentChannel.ConnectionOnConnected(ConnectionCreatedEvent event) in c:\\Projekte\\EasyNetQ\\Source\\EasyNetQ\\Producer\\PersistentChannel.cs:line 57\r\n   at EasyNetQ.EventBus.Publish[TEvent](TEvent event) in c:\\Projekte\\EasyNetQ\\Source\\EasyNetQ\\IEventBus.cs:line 26\r\n   at EasyNetQ.PersistentConnection.OnConnected() in c:\\Projekte\\EasyNetQ\\Source\\EasyNetQ\\PersistentConnection.cs:line 125\r\n   at EasyNetQ.PersistentConnection.TryToConnect(Object timer) in c:\\Projekte\\EasyNetQ\\Source\\EasyNetQ\\PersistentConnection.cs:line 87\r\n   at System.Threading.TimerQueueTimer.CallCallbackInContext(Object state)\r\n   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n   at System.Threading.TimerQueueTimer.CallCallback()\r\n   at System.Threading.TimerQueueTimer.Fire()\r\n   at System.Threading.TimerQueue.FireNextTimers()\r\n   at System.Threading.TimerQueue.AppDomainTimerCallback()\r\n\r\nI have an Exception Handling around the publish\r\nsimiliar to:\r\ntry\r\n{\r\n ...\r\n_bus.Advanced.Publish(new Exchange(exchange), string.Empty, true, false, properties, message.Body);\r\n}catch(Exception ex){\r\n   ....\r\n}\r\n\r\nBUT,\r\nExceptions in TryToConnect, > if(connectionFactory.Succeeded)\r\nare not catched. And because of the Timer I dont have any possiblities to catch it (?).\r\nI dont know why the connection is first created successfully, but then in the handling of OnConnected the connection is lost.\r\n\r\nAny Ideas? I didn't see any fixes for that, therefore I want to ask,\r\nbefore I upgrade to a newer version. \r\n\r\n"}}