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