Exemplo n.º 1
0
        static void Register(StandardConfigurer <ITransport> configurer, string inputQueueAddress,
                             CloudStorageAccount cloudStorageAccount, GooglePubSubTransportOptions optionsOrNull)
        {
            var queueFactory = new CloudQueueClientQueueFactory(cloudStorageAccount.CreateCloudQueueClient());

            Register(configurer, inputQueueAddress, queueFactory, optionsOrNull);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Configures Rebus to use Google Pub/Sub to transport messages as a one-way client (i.e. will not be able to receive any messages)
        /// </summary>
        public static void UseGooglePubSubAsOneWayClient(this StandardConfigurer <ITransport> configurer, ICloudQueueFactory queueFactory, GooglePubSubTransportOptions options = null)
        {
            Register(configurer, null, queueFactory, options);

            OneWayClientBackdoor.ConfigureOneWayClient(configurer);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Configures Rebus to use Google Pub/Sub to transport messages
 /// </summary>
 public static void UseGooglePubSub(this StandardConfigurer <ITransport> configurer, CloudStorageAccount storageAccount, string inputQueueAddress, GooglePubSubTransportOptions options = null)
 {
     Register(configurer, inputQueueAddress, storageAccount, options);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Configures Rebus to use Google Pub/Sub to transport messages
 /// </summary>
 public static void UseGooglePubSub(this StandardConfigurer <ITransport> configurer, ICloudQueueFactory queueFactory, string inputQueueAddress, GooglePubSubTransportOptions options = null)
 {
     Register(configurer, inputQueueAddress, queueFactory, options);
 }
Exemplo n.º 5
0
        /// <summary>
        /// Configures Rebus to use Google Pub/Sub to transport messages as a one-way client (i.e. will not be able to receive any messages)
        /// </summary>
        public static void UseGooglePubSubAsOneWayClient(this StandardConfigurer <ITransport> configurer, CloudStorageAccount storageAccount, GooglePubSubTransportOptions options = null)
        {
            Register(configurer, null, storageAccount, options);

            OneWayClientBackdoor.ConfigureOneWayClient(configurer);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Configures Rebus to use Google Pub/Sub to transport messages
        /// </summary>
        public static void UseGooglePubSub(this StandardConfigurer <ITransport> configurer, string storageAccountConnectionString, string inputQueueAddress, GooglePubSubTransportOptions options = null)
        {
            var storageAccount = CloudStorageAccount.Parse(storageAccountConnectionString);

            Register(configurer, inputQueueAddress, storageAccount, options);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Configures Rebus to use Google Pub/Sub to transport messages as a one-way client (i.e. will not be able to receive any messages)
        /// </summary>
        public static void UseGooglePubSubAsOneWayClient(this StandardConfigurer <ITransport> configurer, string storageAccountConnectionString, GooglePubSubTransportOptions options = null)
        {
            var storageAccount = CloudStorageAccount.Parse(storageAccountConnectionString);

            Register(configurer, null, storageAccount, options);

            OneWayClientBackdoor.ConfigureOneWayClient(configurer);
        }
Exemplo n.º 8
0
        static void Register(StandardConfigurer <ITransport> configurer, string inputQueueAddress, ICloudQueueFactory queueFactory, GooglePubSubTransportOptions optionsOrNull)
        {
            if (configurer == null)
            {
                throw new ArgumentNullException(nameof(configurer));
            }
            if (queueFactory == null)
            {
                throw new ArgumentNullException(nameof(queueFactory));
            }

            var options = optionsOrNull ?? new GooglePubSubTransportOptions();

            configurer.Register(c =>
            {
                var rebusLoggerFactory = c.Get <IRebusLoggerFactory>();
                var rebusTime          = c.Get <IRebusTime>();
                return(new GooglePubSubTransport(queueFactory, inputQueueAddress, rebusLoggerFactory, options, rebusTime));
            });

            if (options.UseNativeDeferredMessages)
            {
                configurer.OtherService <ITimeoutManager>().Register(c => new DisabledTimeoutManager(), description: GoogleTimeoutManagerText);

                configurer.OtherService <IPipeline>().Decorate(c =>
                {
                    var pipeline = c.Get <IPipeline>();

                    return(new PipelineStepRemover(pipeline)
                           .RemoveIncomingStep(s => s.GetType() == typeof(HandleDeferredMessagesStep)));
                });
            }
        }