コード例 #1
0
        private async Task PublishInstance <T>(T instance) where T : class
        {
            var bus        = ServiceBusProvider.GetRabbitMqPublisherBus(_config.RabbitMqUri);
            var busHandler = await bus.StartAsync();

            await bus.Publish <T>(instance);

            await busHandler.StopAsync();
        }
コード例 #2
0
        //publish the message to the queue
        private async Task PublishInstance <T>(T instance) where T : class
        {
            //TODO change this to ServiceBusProvider.GetAzureBus(string hostUri, string accessKeyname, string accessKey) to use with azure service bus
            var bus        = ServiceBusProvider.GetRabbitMqPublisherBus(_config.RabbitMqUri);
            var busHandler = await bus.StartAsync();

            await bus.Publish(instance);

            await busHandler.StopAsync();
        }
コード例 #3
0
        public async Task PublishKeyMap(Dictionary <string, Identifiers> identifiers)
        {
            var bus        = ServiceBusProvider.GetRabbitMqPublisherBus(_config.RabbitMqUri);
            var busHandler = await bus.StartAsync();

            await bus.Publish <IStandardIdentifierMap>(new StandardIdentifierMap()
            {
                InstanceMap   = identifiers,
                MessageOrigin = GetMessageOrigin()
            });

            await busHandler.StopAsync();
        }