Inheritance: IDisposable
Ejemplo n.º 1
0
        private void Initialize(ConsumerConfiguration configuration, ZMQ.Context zeromqContext)
        {
            _configuration = configuration;
            _zeromqContext = zeromqContext;

            _sender = new RequestSender(configuration.Address, ZMQ.SocketType.REQ, _zeromqContext);
        }
Ejemplo n.º 2
0
        public Consumer(String brokerAddress)
        {
            _context = _sharedContext;
            _address = brokerAddress;

            _sender = new RequestSender(_address, ZMQ.SocketType.REQ, _context.ZmqContext);
            _infoResponse = _sender.Send(new BrokerInfoRequest()) as BrokerInfoResponse;

            if (_infoResponse == null)
                throw new Exception("Cannot create producer, because broker info request was unsuccessfull");
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Constructs Producer with specified broker address
        /// </summary>
        public Producer(String brokerAddress)
        {
            _brokerAddress = brokerAddress;
            _sender = new RequestSender(_brokerAddress, ZMQ.SocketType.REQ, _context.ZmqContext);
            _infoResponse = _sender.Send(new BrokerInfoRequest()) as BrokerInfoResponse;

            if (_infoResponse == null)
                throw new Exception("Cannot create producer, because broker info request was unsuccessfull");

            var pullAddress = String.Format("{0}:{1}", _infoResponse.HostName, _infoResponse.PullPort);
            _pushSender = new RequestSender(pullAddress, ZMQ.SocketType.PUSH, _context.ZmqContext);
        }