public void Start() { var factory = ClientConnectionFactory.CreateConnection("localhost"); this.channel = factory.CreateModel(); channel.QueueDeclare("HostQueue", true, false, false, null); consumer = ConsumerFactory.CreateConsumer(channel, "HostQueue", Consumer_Received); }
public bool TryConnect() { lock (syncRoot) { if (IsConnected) { return(true); } connection = ClientConnectionFactory.CreateConnection(settings.HostName); if (IsConnected) { connection.ConnectionShutdown += OnConnectionShutdown; connection.CallbackException += OnCallbackException; connection.ConnectionBlocked += OnConnectionBlocked; return(true); } return(false); } }
public RMQConnectionManager(RMQSettings settings) { this.settings = settings; connection = ClientConnectionFactory.CreateConnection(settings.HostName); }