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); }
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); }
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); }