Example #1
0
        protected PublisherBase(IModel model, string busId, PublisherConfigurator configuration, IMessageHelper messageHelper, ISendHelper sendHelper)
        {
            _model = model;
            _configuration = configuration;
            _messageHelper = messageHelper;
            _sendHelper = sendHelper;
            _busId = busId;

            _model.BasicReturn += ModelOnBasicReturn;
        }
Example #2
0
        protected PublisherBase(IModel model, string busId, PublisherConfigurator configuration, IMessageHelper messageHelper, ISendHelper sendHelper)
        {
            _model         = model;
            _configuration = configuration;
            _messageHelper = messageHelper;
            _sendHelper    = sendHelper;
            _busId         = busId;

            _model.BasicReturn += ModelOnBasicReturn;
        }
 public MessageConsumer(string busId, IModel model, IMessageHelper messageHelper, ISendHelper sendHelper, Dictionary <string, ISerializer> serializers, IErrorSubscriber errorSubscriber, TaskScheduler scheduler, bool receiveSelfPublish, bool neverReply) : base(model)
 {
     _busId              = busId;
     _messageHelper      = messageHelper;
     _serializers        = serializers;
     _errorSubscriber    = errorSubscriber;
     _scheduler          = scheduler;
     _receiveSelfPublish = receiveSelfPublish;
     _neverReply         = neverReply;
     _sendHelper         = sendHelper;
 }
Example #4
0
 public MessageConsumer(string busId, IModel model, IMessageHelper messageHelper, ISendHelper sendHelper, Dictionary<string, ISerializer> serializers, IErrorSubscriber errorSubscriber, TaskScheduler scheduler, bool receiveSelfPublish, bool neverReply)
     : base(model)
 {
     _busId = busId;
     _messageHelper = messageHelper;
     _serializers = serializers;
     _errorSubscriber = errorSubscriber;
     _scheduler = scheduler;
     _receiveSelfPublish = receiveSelfPublish;
     _neverReply = neverReply;
     _sendHelper = sendHelper;
 }
Example #5
0
 public MessageConsumer(string busId, IModel model, IMessageHelper messageHelper, ISendHelper sendHelper, Dictionary <string, ISerializer> serializers, IErrorSubscriber errorSubscriber, bool receiveSelfPublish, bool neverReply, string replyExchange, ITrace trace)
     : base(model)
 {
     _busId              = busId;
     _messageHelper      = messageHelper;
     _serializers        = serializers;
     _errorSubscriber    = errorSubscriber;
     _receiveSelfPublish = receiveSelfPublish;
     _neverReply         = neverReply;
     _sendHelper         = sendHelper;
     _replyExchange      = replyExchange;
     _trace              = trace;
 }
Example #6
0
        public MessageConsumer(string busId, IModel model, IMessageHelper messageHelper, ISendHelper sendHelper, Dictionary<string, ISerializer> serializers, IErrorSubscriber errorSubscriber, TaskScheduler scheduler, bool receiveSelfPublish, bool neverReply, string replyExchange, ITrace trace)
            : base(model)
        {
            _busId = busId;
            _messageHelper = messageHelper;
            _serializers = serializers;
            _errorSubscriber = errorSubscriber;
            _receiveSelfPublish = receiveSelfPublish;
            _neverReply = neverReply;
            _sendHelper = sendHelper;
            _replyExchange = replyExchange;
            _trace = trace;

            _taskFactory = new TaskFactory(CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskContinuationOptions.None, scheduler);
        }
Example #7
0
        public MessageConsumer(string busId, IModel model, IMessageHelper messageHelper, ISendHelper sendHelper, Dictionary <string, ISerializer> serializers, IErrorSubscriber errorSubscriber, TaskScheduler scheduler, bool receiveSelfPublish, bool neverReply, string replyExchange, ITrace trace)
            : base(model)
        {
            _busId              = busId;
            _messageHelper      = messageHelper;
            _serializers        = serializers;
            _errorSubscriber    = errorSubscriber;
            _receiveSelfPublish = receiveSelfPublish;
            _neverReply         = neverReply;
            _sendHelper         = sendHelper;
            _replyExchange      = replyExchange;
            _trace              = trace;

            _taskFactory = new TaskFactory(CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskContinuationOptions.None, scheduler);
        }
Example #8
0
 public ConfirmPublisher(IModel model, string busId, PublisherConfigurator configuration, IMessageHelper messageHelper, ISendHelper sendHelper)
     : base(model, busId, configuration, messageHelper, sendHelper)
 {
     _model.ConfirmSelect();
 }
 public TransactionalMessageConsumer(string busId, IModel model, IMessageHelper messageHelper, ISendHelper sendHelper, IExceptionFilter exceptionFilter, Dictionary <string, ISerializer> serializers, IErrorSubscriber errorSubscriber, TaskScheduler scheduler, bool receiveSelfPublish, bool neverReply, string replyExchange, ITrace trace)
     : base(busId, model, messageHelper, sendHelper, serializers, errorSubscriber, scheduler, receiveSelfPublish, neverReply, replyExchange, trace)
 {
     _exceptionFilter = exceptionFilter;
 }
 public TransactionalMessageConsumer(string busId, IModel model, IMessageHelper messageHelper, ISendHelper sendHelper, IExceptionFilter exceptionFilter, Dictionary<string, ISerializer> serializers, IErrorSubscriber errorSubscriber, TaskScheduler scheduler, bool receiveSelfPublish, bool neverReply, string replyExchange, ITrace trace)
     : base(busId, model, messageHelper, sendHelper, serializers, errorSubscriber, scheduler, receiveSelfPublish, neverReply, replyExchange, trace)
 {
     _exceptionFilter = exceptionFilter;
 }
 public TransactionalPublisher(IModel model, string busId, PublisherConfigurator configuration, IMessageHelper messageHelper, ISendHelper sendHelper)
     : base(model, busId, configuration, messageHelper, sendHelper)
 {
     _model.TxSelect();
 }
Example #12
0
 public RpcSyncPublisher(IModel model, string busId, RpcPublisherConfigurator configuration, IMessageHelper messageHelper, ISendHelper sendHelper, IRpcConsumer consumer)
     : base(model, busId, configuration, messageHelper, sendHelper, consumer)
 {
 }
 public TransactionalMessageConsumer(string busId, IModel model, IMessageHelper messageHelper, ISendHelper sendHelper, Dictionary<string, ISerializer> serializers, IErrorSubscriber errorSubscriber, TaskScheduler scheduler, bool receiveSelfPublish, bool neverReply)
     : base(busId, model, messageHelper, sendHelper, serializers, errorSubscriber, scheduler, receiveSelfPublish, neverReply)
 {
 }
Example #14
0
        public RpcPublisher(IModel model, string busId, PublisherConfigurator configuration, IMessageHelper messageHelper, ISendHelper sendHelper, IRpcConsumer consumer) : base(model, busId, configuration, messageHelper, sendHelper)
        {
            _consumer = consumer;

            model.BasicConsume(Queue, true, consumer);
        }
Example #15
0
 public TransactionalMessageConsumer(string busId, IModel model, IMessageHelper messageHelper, ISendHelper sendHelper, Dictionary <string, ISerializer> serializers, IErrorSubscriber errorSubscriber, TaskScheduler scheduler, bool receiveSelfPublish, bool neverReply)
     : base(busId, model, messageHelper, sendHelper, serializers, errorSubscriber, scheduler, receiveSelfPublish, neverReply)
 {
 }
Example #16
0
        protected RpcPublisherBase(IModel model, string busId, RpcPublisherConfigurator configuration, IMessageHelper messageHelper, ISendHelper sendHelper, IRpcConsumer consumer)
            : base(model, busId, configuration, messageHelper, sendHelper)
        {
            _consumer = consumer;

            const string fastReplyQueue = "amq.rabbitmq.reply-to";

            if (configuration.UseFastReply)
            {
                _consumerTag = model.BasicConsume(fastReplyQueue, true, configuration.ConsumerTag, consumer);

                _replyTo = fastReplyQueue;
            }
            else
            {
                QueueDeclareOk queueDeclare = model.QueueDeclare("", false, true, true, new Dictionary <string, object>());

                if (string.IsNullOrEmpty(configuration.ReplyExchange))
                {
                    // Use default exchange, no need to bind queue

                    _replyTo = queueDeclare.QueueName;
                }
                else
                {
                    // Bind queue to specified exchange by replyTo or generate unique routing key
                    string routingKey = configuration.ReplyTo ?? NewMiniGuid();

                    model.QueueBind(queueDeclare.QueueName, configuration.ReplyExchange, routingKey);

                    _replyTo = routingKey;
                }

                _consumerTag = model.BasicConsume(queueDeclare.QueueName, true, configuration.ConsumerTag, consumer);
            }
        }
Example #17
0
 public Publisher(IModel model, string busId, PublisherConfigurator configuration, IMessageHelper messageHelper, ISendHelper sendHelper) : base(model, busId, configuration, messageHelper, sendHelper)
 {
 }