Created
November 12, 2013 04:44
-
-
Save agilejon/7425595 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void InitializeRabbitConnection() | |
{ | |
ConnectionFactory = new ConnectionFactory() | |
{ | |
HostName = "localhost", | |
Port = 5672, | |
UserName = "myapp", | |
Password = "password", | |
RequestedHeartbeat = 4, // heartbeat is what lets your code detect problems communicating with | |
// the RabbitMQ server. A heartbeat of 4 will cause the server to send | |
// a heartbeat 'ping' message every 4 seconds. If the client has not | |
// received a ping in 8 seconds (heartbeat*2) then it will consider the | |
// connection to be bad and throw a ConnectionShutdown event. | |
}; | |
var SingletonConnection = ConnectionFactory.CreateConnection(); | |
SingletonConnection.ConnectionShutdown += SingletonConnection_ConnectionShutdown; // handle disconnects | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment