Пример #1
0
 public static ICanAddEndpointOrLoggingOrCorrelationOrCreate <IMessage, ICommand, IEvent, IRequest, IResponse> WithActiveMQSharedConnectionScope <TServiceMessage>(
     this ICanAddEndpoint <IMessage, ICommand, IEvent, IRequest, IResponse> canAddEndpoint,
     string brokerUri, string userName, string password,
     Func <ICanAddEndpoint <IMessage, ICommand, IEvent, IRequest, IResponse>, ICanAddEndpointOrLoggingOrCorrelationOrCreate <IMessage, ICommand, IEvent, IRequest, IResponse> > endPointFactory) where TServiceMessage : class
 {
     return(canAddEndpoint.WithActiveMQSharedConnectionScope(brokerUri, userName, password, endPointFactory));
 }
Пример #2
0
        public static ICanAddEndpointOrLoggingOrCorrelationOrCreate <TMessage, TCommand, TEvent, TRequest, TResponse> WithActiveMQSharedConnectionScope <TMessage, TCommand, TEvent, TRequest, TResponse>(
            this ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse> canAddEndpoint,
            string brokerUri, string userName, string password,
            Action <ConnectionFactory> connectionFactoryConfig,
            Func <ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse>, ICanAddEndpointOrLoggingOrCorrelationOrCreate <TMessage, TCommand, TEvent, TRequest, TResponse> > endPointFactory)
            where TMessage : class
            where TCommand : class, TMessage
            where TEvent : class, TMessage
            where TRequest : class, TMessage
            where TResponse : class, TMessage
        {
            var connectionFactory = new ConnectionFactory(brokerUri, ConnectionClientId.CreateWithSuffix("Shared"))
            {
                CopyMessageOnSend = false // We never reuse our messages so don't need to clone when sending
            };

            connectionFactoryConfig(connectionFactory);

            var connection = !string.IsNullOrEmpty(userName)
                ? connectionFactory.CreateConnection(userName, password)
                : connectionFactory.CreateConnection();

            ActiveMQFluentConfigContext.SharedConnection = connection.GetLazyConnection();

            var result = endPointFactory(canAddEndpoint);

            ActiveMQFluentConfigContext.SharedConnection = null;
            return(result);
        }
Пример #3
0
 WithActiveMQEndpoint <TServiceMessage, TMessage, TCommand, TEvent, TRequest, TResponse>(
     this ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse> canAddEndpoint,
     Func <ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse>, ICanSpecifyEndpointSerializers <TMessage, TCommand, TEvent, TRequest, TResponse> > endPointFactory)
     where TMessage : class
     where TServiceMessage : class
     where TCommand : class, TMessage
     where TEvent : class, TMessage
     where TRequest : class, TMessage
     where TResponse : class, TMessage
 {
     return(endPointFactory(canAddEndpoint));
 }
Пример #4
0
 public static ICanAddEndpointOrLoggingOrCorrelationOrCreate <TMessage, TCommand, TEvent, TRequest, TResponse> WithActiveMQSharedConnectionScope <TMessage, TCommand, TEvent, TRequest, TResponse>(
     this ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse> canAddEndpoint,
     string brokerUri,
     Func <ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse>, ICanAddEndpointOrLoggingOrCorrelationOrCreate <TMessage, TCommand, TEvent, TRequest, TResponse> > endPointFactory)
     where TMessage : class
     where TCommand : class, TMessage
     where TEvent : class, TMessage
     where TRequest : class, TMessage
     where TResponse : class, TMessage
 {
     return(canAddEndpoint.WithActiveMQSharedConnectionScope(brokerUri, null, null, cf => { }, endPointFactory));
 }
Пример #5
0
 /// <summary>
 /// Extension method to create an instance of a fluent configurator for Azure storage queue
 /// </summary>
 /// <param name="canAddEndpoint"></param>
 /// <typeparam name="TServiceMessage"></typeparam>
 /// <typeparam name="TMessage"></typeparam>
 /// <typeparam name="TCommand"></typeparam>
 /// <typeparam name="TEvent"></typeparam>
 /// <typeparam name="TRequest"></typeparam>
 /// <typeparam name="TResponse"></typeparam>
 /// <returns></returns>
 public static ICanSpecifyAzureStorageQueueCredentials <TMessage, TCommand, TEvent, TRequest, TResponse> WithAzureStorageQueueEndpoint <TServiceMessage, TMessage, TCommand, TEvent, TRequest, TResponse>(this ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse> canAddEndpoint)
     where TServiceMessage : class
     where TMessage : class
     where TCommand : class, TMessage
     where TEvent : class, TMessage
     where TRequest : class, TMessage
     where TResponse : class, TMessage
 {
     return(new AzureStorageQueueFluentConfig <TServiceMessage, TMessage, TCommand, TEvent, TRequest, TResponse>(canAddEndpoint));
 }
        public static ICanAddEndpointOrLoggingOrCorrelationOrCreate <TMessage, TCommand, TEvent, TRequest, TResponse> WithEventStoreSharedConnectionScope <TMessage, TCommand, TEvent, TRequest, TResponse>(this ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse> canAddEndpoint, string connectionString,
                                                                                                                                                                                                            Func <ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse>, ICanAddEndpointOrLoggingOrCorrelationOrCreate <TMessage, TCommand, TEvent, TRequest, TResponse> > endPointFactory)
            where TMessage : class
            where TCommand : class, TMessage
            where TEvent : class, TMessage
            where TRequest : class, TMessage
            where TResponse : class, TMessage
        {
            EventStoreFluentConfigContext.SharedConnection = EventStoreConnection.Create(connectionString).AsLazy();

            var result = endPointFactory(canAddEndpoint);

            EventStoreFluentConfigContext.SharedConnection = null;
            return(result);
        }
 public static ICanAddEndpointOrLoggingOrCorrelationOrCreate <IMessage, ICommand, IEvent, IRequest, IResponse> WithEventStoreSharedConnectionScope <TServiceMessage>(this ICanAddEndpoint <IMessage, ICommand, IEvent, IRequest, IResponse> canAddEndpoint, string connectionString,
                                                                                                                                                                     Func <ICanAddEndpoint <IMessage, ICommand, IEvent, IRequest, IResponse>, ICanAddEndpointOrLoggingOrCorrelationOrCreate <IMessage, ICommand, IEvent, IRequest, IResponse> > endPointFactory)
     where TServiceMessage : class
 {
     return(canAddEndpoint.WithEventStoreSharedConnectionScope(connectionString, endPointFactory));
 }
Пример #8
0
 public static ICanSpecifyRabbitMQServiceName <IMessage, ICommand, IEvent, IRequest, IResponse> WithRabbitMQEndpoints <TServiceMessage>(this ICanAddEndpoint <IMessage, ICommand, IEvent, IRequest, IResponse> canAddEndpoint)
     where TServiceMessage : class
 {
     return(new RabbitMQFluentConfig <TServiceMessage, IMessage, ICommand, IEvent, IRequest, IResponse>(canAddEndpoint));
 }
 public static ICanSpecifyEventStoreServiceName <TMessage, TCommand, TEvent, TRequest, TResponse> WithEventStoreEndpoints <TServiceMessage, TMessage, TCommand, TEvent, TRequest, TResponse>(this ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse> canAddEndpoint)
     where TMessage : class
     where TServiceMessage : class
     where TCommand : class, TMessage
     where TEvent : class, TMessage
     where TRequest : class, TMessage
     where TResponse : class, TMessage
 {
     return(new EventStoreFluentConfig <TServiceMessage, TMessage, TCommand, TEvent, TRequest, TResponse>(canAddEndpoint));
 }
 public static ICanAddAzureServiceBusServiceName <IMessage, ICommand, IEvent, IRequest, IResponse> WithAzureServiceBusEndpoint <TServiceMessage>(this ICanAddEndpoint <IMessage, ICommand, IEvent, IRequest, IResponse> canAddEndpoint) where TServiceMessage : class
 {
     return(canAddEndpoint.WithAzureServiceBusEndpoint <TServiceMessage, IMessage, ICommand, IEvent, IRequest, IResponse>());
 }
Пример #11
0
 public NatsFluentConfig(ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse> canAddEndpoint,
                         NatsEndpointSettings <TMessage> settings)
 {
     _canAddEndpoint = canAddEndpoint;
     _settings       = settings;
 }
Пример #12
0
 /// <summary>
 /// Extension method to create an instance of a fluent configurator for Azure storage queue
 /// </summary>
 /// <param name="canAddEndpoint"></param>
 /// <typeparam name="TServiceMessage"></typeparam>
 /// <returns></returns>
 public static ICanSpecifyAzureStorageQueueServiceName <IMessage, ICommand, IEvent, IRequest, IResponse> WithAzureStorageQueueEndpoint <TServiceMessage>(this ICanAddEndpoint <IMessage, ICommand, IEvent, IRequest, IResponse> canAddEndpoint)
     where TServiceMessage : class
 {
     return(new AzureStorageQueueFluentConfig <TServiceMessage, IMessage, ICommand, IEvent, IRequest, IResponse>(canAddEndpoint));
 }
Пример #13
0
        WithNatsEndpoint <TServiceMessage, TMessage, TCommand, TEvent, TRequest, TResponse>(this ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse> canAddEndpoint,
                                                                                            Action <NatsEndpointSettings <TMessage> > setSettings)
            where TMessage : class
            where TServiceMessage : class
            where TCommand : class, TMessage
            where TEvent : class, TMessage
            where TRequest : class, TMessage
            where TResponse : class, TMessage
        {
            var settings = new NatsEndpointSettings <TMessage>();

            setSettings(settings);
            return(new NatsFluentConfig <TServiceMessage, TMessage, TCommand, TEvent, TRequest, TResponse>(canAddEndpoint, settings));
        }
Пример #14
0
 WithActiveMQEndpoints <TServiceMessage, TMessage, TCommand, TEvent, TRequest, TResponse>(this ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse> canAddEndpoint)
     where TMessage : class
     where TServiceMessage : class
     where TCommand : class, TMessage
     where TEvent : class, TMessage
     where TRequest : class, TMessage
     where TResponse : class, TMessage
 {
     return(new ActiveMQFluentConfig <TServiceMessage, TMessage, TCommand, TEvent, TRequest, TResponse>(canAddEndpoint));
 }
 public static ICanAddAzureServiceBusServiceName <TMessage, TCommand, TEvent, TRequest, TResponse> WithAzureServiceBusEndpoint <TServiceMessage, TMessage, TCommand, TEvent, TRequest, TResponse>(this ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse> canAddEndpoint)
     where TServiceMessage : class
     where TMessage : class
     where TCommand : class, TMessage
     where TEvent : class, TMessage
     where TRequest : class, TMessage
     where TResponse : class, TMessage
 {
     return(new AzureServiceBusFluentConfig <TServiceMessage, TMessage, TCommand, TEvent, TRequest, TResponse>(canAddEndpoint));
 }
Пример #16
0
 WithNoneEndpoints(this ICanAddEndpoint <IMessage, ICommand, IEvent, IRequest, IResponse> canAddEndpoint)
 {
     return(canAddEndpoint.WithEndpoints(new NoneEndPointProvider()));
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="canAddEndpoint"></param>
 public AzureStorageQueueFluentConfig(ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse> canAddEndpoint)
 {
     _canAddEndpoint = canAddEndpoint;
 }
 public AzureServiceBusFluentConfig(ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse> canAddEndpoint)
 {
     _canAddEndpoint = canAddEndpoint;
 }
Пример #19
0
 public KafkaFluentConfig(ICanAddEndpoint <TMessage, TCommand, TEvent, TRequest, TResponse> canAddEndpoint)
 {
     _canAddEndpoint = canAddEndpoint;
 }
Пример #20
0
 public static ICanAddNetMqServiceName <IMessage, ICommand, IEvent, IRequest, IResponse> WithNetMqEndpoints <TServiceMessage>(this ICanAddEndpoint <IMessage, ICommand, IEvent, IRequest, IResponse> canAddEndpoint)
     where TServiceMessage : class, IMessage
 {
     return(new NetMqFluentConfig <TServiceMessage, IMessage, ICommand, IEvent, IRequest, IResponse>(canAddEndpoint));
 }