コード例 #1
0
ファイル: SimpleRabbitMQTopology.cs プロジェクト: dsomok/TBot
        public IEndpoint ResolveCommandReplyToEndpoint(string replyTo)
        {
            if (!this._endpointRegistry.TryGet(replyTo, out IEndpoint replyToEndpoint))
            {
                replyToEndpoint = new RabbitMQQueueEndpoint(replyTo, this._connectionFactory);
                this._endpointRegistry[replyTo] = replyToEndpoint;
            }

            return(replyToEndpoint);
        }
コード例 #2
0
ファイル: SimpleRabbitMQTopology.cs プロジェクト: dsomok/TBot
        public IEndpoint ResolveCommandSubscriptionEndpoint <TCommand>(string service) where TCommand : ICommand
        {
            var queueName = $"{service}.{typeof(TCommand).FullName}";

            if (!this._endpointRegistry.TryGet(queueName, out RabbitMQQueueEndpoint queueEndpoint))
            {
                queueEndpoint = new RabbitMQQueueEndpoint(queueName, this._connectionFactory);
                queueEndpoint.Bind(
                    exchangeName: COMMANDS_EXCHANGE,
                    routingKey: this.GetCommandTopic <TCommand>(service)
                    );

                this._endpointRegistry[queueName] = queueEndpoint;
            }

            return(queueEndpoint);
        }
コード例 #3
0
ファイル: SimpleRabbitMQTopology.cs プロジェクト: dsomok/TBot
        public IEndpoint ResolveEventSubscriptionEndpoint <TEvent>(string service) where TEvent : IEvent
        {
            var queueName = $"{service}.{typeof(TEvent).FullName}";

            if (!this._endpointRegistry.TryGet(queueName, out RabbitMQQueueEndpoint queueEndpoint))
            {
                queueEndpoint = new RabbitMQQueueEndpoint(queueName, this._connectionFactory);
                queueEndpoint.Bind(
                    exchangeName: EVENTS_EXCHANGE,
                    routingKey: this.GetEventTopic <TEvent>()
                    );

                this._endpointRegistry[queueName] = queueEndpoint;
            }

            return(queueEndpoint);
        }