Example #1
0
 public ReplyDelivery(string exchange,
     RogerEndpoint recipient,
     byte[] body,
     Action<BasicReturn> basicReturnCallback,
     Func<RogerEndpoint, IBasicProperties> createProperties)
     : base(createProperties, basicReturnCallback, exchange, recipient, body)
 {
 }
Example #2
0
 public SendFactory(Type messageType, string exchange, RogerEndpoint recipient, byte[] body, Action<BasicReturn> basicReturnCallback, bool persistent)
     : base(messageType, persistent)
 {
     this.exchange = exchange;
     this.recipient = recipient;
     this.body = body;
     this.basicReturnCallback = basicReturnCallback;
 }
Example #3
0
 public ReplyDelivery(string exchange,
                      RogerEndpoint recipient,
                      byte[] body,
                      Action <BasicReturn> basicReturnCallback,
                      Func <RogerEndpoint, IBasicProperties> createProperties)
     : base(createProperties, basicReturnCallback, exchange, recipient, body)
 {
 }
Example #4
0
        public void Execute(IModel model, RogerEndpoint endpoint, IPublishModule module)
        {
            var properties = createProperties(endpoint);

            module.BeforePublish(this, model, properties, basicReturnCallback);

            ExecuteCore(model, properties);
        }
Example #5
0
        public void Execute(IModel model, RogerEndpoint endpoint, IPublishModule module)
        {
            var properties = createProperties(endpoint);

            module.BeforePublish(this, model, properties, basicReturnCallback);

            ExecuteCore(model, properties);
        }
        void IReceive <ConsumingEnabled> .Receive(ConsumingEnabled message)
        {
            endpoint = message.Endpoint;
            model    = message.Connection.CreateModel();

            modules.BeforePublishEnabled(model);

            EnablePublishing();
        }
        public void Send(RogerEndpoint recipient, object message, Action <BasicReturn> basicReturnCallback, bool persistent, bool sequence)
        {
            var messageType = message.GetType();

            Enqueue(new SendFactory(messageType,
                                    Exchange(messageType),
                                    recipient,
                                    Serialize(message),
                                    basicReturnCallback,
                                    persistent,
                                    sequence));
        }
Example #8
0
 public SendFactory(Type messageType,
                    string exchange,
                    RogerEndpoint recipient,
                    byte[] body,
                    Action <BasicReturn> basicReturnCallback,
                    bool persistent,
                    bool sequence) : base(messageType, persistent, sequence)
 {
     this.exchange            = exchange;
     this.recipient           = recipient;
     this.body                = body;
     this.basicReturnCallback = basicReturnCallback;
 }
Example #9
0
        private void StartConsuming(IReliableConnection connection)
        {
            Model = connection.CreateModel();
            Model.ModelShutdown += ModelOnModelShutdown;

            if (options.PrefetchCount.HasValue)
            {
                log.InfoFormat("Setting QoS with prefetch count {0} on consuming channel", options.PrefetchCount);
                Model.BasicQos(0, options.PrefetchCount.Value, false);
            }

            Endpoint = new RogerEndpoint(Endpoint.IsEmpty ? queueFactory.Create(Model) : queueFactory.Create(Endpoint.Queue, Model));

            CreateBindings(new HashSet <Type>(consumerContainer.GetAllConsumerTypes().SelectMany(supportedMessageTypesResolver.Resolve)));
            log.DebugFormat("Declared and eventually bound endpoint {0}", Endpoint);

            aggregator.Notify(new ConsumingEnabled(Endpoint, connection));

            CreateConsumer();

            consumingTask = Task.Factory.StartNew(ConsumeSynchronously, TaskCreationOptions.LongRunning);
        }
 public SequenceKey(RogerEndpoint endpoint, Type messageType)
 {
     Endpoint = endpoint;
     MessageType = messageType.HierarchyRoot();
 }
Example #11
0
 public ConsumingEnabled(RogerEndpoint endpoint, IReliableConnection connection)
 {
     Endpoint = endpoint;
     Connection = connection;
 }
Example #12
0
 public ConsumingEnabled(RogerEndpoint endpoint, IReliableConnection connection)
 {
     Endpoint   = endpoint;
     Connection = connection;
 }
 public SequenceKey(RogerEndpoint endpoint, Type messageType)
 {
     Endpoint    = endpoint;
     MessageType = messageType.HierarchyRoot();
 }