Пример #1
0
        public Task Ping()
        {
            return(_agent.Ping(channel =>
            {
                var envelope = Envelope.ForPing();
                envelope.Destination = Destination;

                var props = _agent.Channel.CreateBasicProperties();

                _mapper.WriteFromEnvelope(envelope, props);
                props.AppId = "Jasper";

                channel.BasicPublish(_address, props, envelope.Data);
            }));
        }
Пример #2
0
        private Task send(Envelope envelope)
        {
            try
            {
                var props = _channel.CreateBasicProperties();
                props.Persistent = _agent.IsDurable;

                _mapper.WriteFromEnvelope(envelope, props);
                _channel.BasicPublish(_address, props, envelope.Data);

                return(_callback.Successful(envelope));
            }
            catch (Exception e)
            {
                return(_callback.ProcessingFailure(envelope, e));
            }
        }