Exemplo n.º 1
0
        public async Task PublishMessage(IntegrationBaseMessage message, string topicName)
        {
            var connectionString = _config["AzureServiceBusConnectionString"].ToString();

            ISenderClient topicClient       = new TopicClient(connectionString, topicName);
            var           jsonMessage       = JsonConvert.SerializeObject(message);
            var           serviceBusMessage = new Message(Encoding.UTF8.GetBytes(jsonMessage))
            {
                CorrelationId = Guid.NewGuid().ToString()
            };

            await topicClient.SendAsync(serviceBusMessage);

            Console.WriteLine(($"Sent message to {topicClient.Path}"));
            await topicClient.CloseAsync();
        }
Exemplo n.º 2
0
 public Task PublishMessage(IntegrationBaseMessage message)
 {
     throw new NotImplementedException();
 }