/// <summary>
        /// Configure connection and authentication information about the Azure Service Bus usage
        /// within this Jasper application
        /// </summary>
        /// <param name="endpoints"></param>
        /// <param name="configure"></param>
        public static void ConfigureAzureServiceBus(this IEndpoints endpoints, Action <IAzureServiceBusTransport> configure)
        {
            var transport = endpoints.AsbTransport();

            endpoints.As <TransportCollection>().Subscribers.Fill(transport.Topics);
            configure(transport);
        }
示例#2
0
        /// <summary>
        /// Listen for incoming messages at the designated Kafka Topic by name
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <typeparam name="TVal"></typeparam>
        /// <param name="endpoints"></param>
        /// <param name="topicName"></param>
        /// <param name="consumerConfig"></param>
        /// <returns></returns>
        public static KafkaListenerConfiguration ListenToKafkaTopic(this IEndpoints endpoints, string topicName, ConsumerConfig consumerConfig)
        {
            var endpoint = endpoints.KafkaTransport().EndpointForTopic(topicName, consumerConfig);

            endpoint.IsListener = true;
            return(new KafkaListenerConfiguration(endpoint));
        }
示例#3
0
 internal Nets(string merchantId, string token, IApiCaller caller, IEndpoints endpoints)
 {
     this._merchantId = merchantId;
     this._token      = token;
     this._caller     = caller;
     this._endpoints  = endpoints;
 }
示例#4
0
        /// <summary>
        /// Listen for incoming messages at the designated Rabbit MQ queue by name
        /// </summary>
        /// <param name="endpoints"></param>
        /// <param name="queueName">The name of the Rabbit MQ queue</param>
        /// <returns></returns>
        public static RabbitMqListenerConfiguration ListenToRabbitQueue(this IEndpoints endpoints, string queueName)
        {
            var endpoint = endpoints.RabbitMqTransport().EndpointForQueue(queueName);

            endpoint.IsListener = true;
            return(new RabbitMqListenerConfiguration(endpoint));
        }
        /// <summary>
        /// Configure connection and authentication information about the Azure Service Bus usage
        /// within this Jasper application
        /// </summary>
        /// <param name="endpoints"></param>
        /// <param name="configure"></param>
        public static void ConfigurePulsar(this IEndpoints endpoints, Action <DotPulsarTransport> configure)
        {
            var transport = endpoints.PulsarTransport();

            endpoints.As <TransportCollection>().Subscribers.Fill(transport.Topics);
            configure(transport);
        }
 public static void ConfigurePulsar(this IEndpoints endpoints, Uri pulsarCluster)
 {
     endpoints.ConfigurePulsar(_ =>
     {
         _.PulsarClient = new PulsarClientBuilder().ServiceUrl(pulsarCluster).Build();
     });
 }
 public static void ConfigurePulsar(this IEndpoints endpoints, IPulsarClientBuilder pulsarClientBuilder)
 {
     endpoints.ConfigurePulsar(_ =>
     {
         _.PulsarClient = pulsarClientBuilder.Build();
     });
 }
        public static DotPulsarListenerConfiguration ListenToPulsarTopic(this IEndpoints endpoints, ConsumerOptions consumerConfig)
        {
            var endpoint = endpoints.PulsarTransport().EndpointFor(consumerConfig);

            endpoint.IsListener = true;
            return(new DotPulsarListenerConfiguration(endpoint));
        }
示例#9
0
        public override KafkaSubscriberConfiguration FindConfigurationForTopic(string topicName,
                                                                               IEndpoints endpoints)
        {
            var uri      = BuildUriForTopic(topicName);
            var endpoint = endpoints.As <TransportCollection>().GetOrCreateEndpoint(uri);

            return(new KafkaSubscriberConfiguration((KafkaEndpoint)endpoint));
        }
示例#10
0
        public override DotPulsarSubscriberConfiguration FindConfigurationForTopic(string topicName,
                                                                                   IEndpoints endpoints)
        {
            Uri      uri      = BuildUriForTopic(topicName);
            Endpoint endpoint = endpoints.As <TransportCollection>().GetOrCreateEndpoint(uri);

            return(new DotPulsarSubscriberConfiguration((DotPulsarEndpoint)endpoint));
        }
示例#11
0
        /// <summary>
        /// Quick access to the Rabbit MQ Transport within this application.
        /// This is for advanced usage
        /// </summary>
        /// <param name="endpoints"></param>
        /// <returns></returns>
        internal static RabbitMqTransport RabbitMqTransport(this IEndpoints endpoints)
        {
            var transports = endpoints.As <TransportCollection>();
            var transport  = transports.Get <RabbitMqTransport>();

            if (transport == null)
            {
                transport = new RabbitMqTransport();
                transports.Add(transport);
            }

            return(transport);
        }
        /// <summary>
        /// Quick access to the Azure Service Bus Transport within this application.
        /// This is for advanced usage
        /// </summary>
        /// <param name="endpoints"></param>
        /// <returns></returns>
        internal static AzureServiceBusTransport AsbTransport(this IEndpoints endpoints)
        {
            var transports = endpoints.As <TransportCollection>();

            var transport = transports.Get <AzureServiceBusTransport>();

            if (transport == null)
            {
                transport = new AzureServiceBusTransport();
                transports.Add(transport);
            }

            transports.Subscribers.Fill(transport.Topics);

            return(transport);
        }
    {/// <summary>
        /// Quick access to the pulsar Transport within this application.
        /// This is for advanced usage
        /// </summary>
        /// <param name="endpoints"></param>
        /// <returns></returns>
        internal static DotPulsarTransport PulsarTransport(this IEndpoints endpoints)
        {
            var transports = endpoints.As <TransportCollection>();

            var transport = transports.Get <DotPulsarTransport>();

            if (transport == null)
            {
                transport = new DotPulsarTransport();
                transports.Add(transport);
            }

            transports.Subscribers.Fill(transport.Topics);

            return(transport);
        }
示例#14
0
 public static Nets Create(string merchantId, string token, IEndpoints endpoints)
 {
     return(new Nets(merchantId, token, new HttpClientApiCaller(), endpoints));
 }
 /// <summary>
 /// Listen for incoming messages at the designated Pulsar Topic by name
 /// </summary>
 /// <typeparam name="TKey"></typeparam>
 /// <typeparam name="TVal"></typeparam>
 /// <param name="endpoints"></param>
 /// <param name="topicName"></param>
 /// <param name="consumerConfig"></param>
 /// <returns></returns>
 public static DotPulsarListenerConfiguration ListenToPulsarTopic(this IEndpoints endpoints, string subscription, string topicName) =>
 ListenToPulsarTopic(endpoints, new ConsumerOptions(subscription, topicName));
 /// <summary>
 /// Configure connection and authentication information about the Azure Service Bus usage
 /// within this Jasper application
 /// </summary>
 /// <param name="endpoints"></param>
 /// <param name="configure"></param>
 public static void ConfigureAzureServiceBus(this IEndpoints endpoints, string connectionString)
 {
     endpoints.ConfigureAzureServiceBus(asb => asb.ConnectionString = connectionString);
 }
        /// <summary>
        /// Listen for incoming messages at the designated Rabbit MQ queue by name
        /// </summary>
        /// <param name="endpoints"></param>
        /// <param name="queueName">The name of the Rabbit MQ queue</param>
        /// <returns></returns>
        public static AzureServiceBusListenerConfiguration ListenToAzureServiceBusQueue(this IEndpoints endpoints, string queueName)
        {
            var endpoint = endpoints.AsbTransport().EndpointForQueue(queueName);

            endpoint.IsListener = true;
            return(new AzureServiceBusListenerConfiguration(endpoint));
        }
 /// <summary>
 /// Configure connection and authentication information about the Azure Service Bus usage
 /// within this Jasper application
 /// </summary>
 /// <param name="endpoints"></param>
 /// <param name="configure"></param>
 public static void ConfigurePulsar(this IEndpoints endpoints, IPulsarClient client)
 {
     endpoints.ConfigurePulsar(_ => { _.PulsarClient = client; });
 }
        /// <summary>
        /// Listen for incoming messages at the designated Rabbit MQ queue by name
        /// </summary>
        /// <param name="endpoints"></param>
        /// <param name="queueName">The name of the Rabbit MQ queue</param>
        /// <returns></returns>
        public static AzureServiceBusListenerConfiguration ListenToAzureServiceBusTopic(this IEndpoints endpoints, string topicName, string subscriptionName)
        {
            var raw = new AzureServiceBusEndpoint {
                TopicName = topicName, SubscriptionName = subscriptionName
            }.Uri;
            var endpoint = endpoints.AsbTransport().GetOrCreateEndpoint(raw);

            endpoint.IsListener = true;
            return(new AzureServiceBusListenerConfiguration((AzureServiceBusEndpoint)endpoint));
        }
示例#20
0
 public abstract TSubscriberConfiguration FindConfigurationForTopic(string topicName, IEndpoints endpoints);
 /// <summary>
 /// Initializes a new instance of <see cref="EndpointsBootProcedure"/>
 /// </summary>
 /// <param name="endpoints">Instance of <see cref="IEndpoints"/> to boot</param>
 public EndpointsBootProcedure(IEndpoints endpoints)
 {
     _endpoints = endpoints;
 }
 public TopicRouterConfiguration(TopicRouter <TSubscriberConfiguration> router, IEndpoints endpoints)
 {
     _router    = router;
     _endpoints = endpoints;
 }
示例#23
0
 /// <summary>
 /// Configure connection and authentication information about the Rabbit MQ usage
 /// within this Jasper application
 /// </summary>
 /// <param name="endpoints"></param>
 /// <param name="configure"></param>
 public static void ConfigureRabbitMq(this IEndpoints endpoints, Action <IRabbitMqTransport> configure)
 {
     configure(endpoints.RabbitMqTransport());
 }
示例#24
0
 /// <summary>
 /// Configure connection and authentication information about the Azure Service Bus usage
 /// within this Jasper application
 /// </summary>
 /// <param name="endpoints"></param>
 /// <param name="configure"></param>
 public static void ConfigureKafka(this IEndpoints endpoints)
 {
     endpoints.ConfigureKafka(_ =>
     {
     });
 }