Пример #1
0
 public async Task SendMessage(string messageName, string correlationKey)
 {
     await _client.NewPublishMessageCommand()
     .MessageName(messageName)
     .CorrelationKey(correlationKey)
     .Send();
 }
Пример #2
0
        public async Task <String> SendMessage(string instanceId, string messageName, string payload)
        {
            var instance = await _client.NewPublishMessageCommand()
                           .MessageName(messageName)
                           .CorrelationKey(instanceId)
                           .TimeToLive(TimeSpan.FromMinutes(30))
                           .Variables(payload)
                           .Send();

            string jsonText = JsonSerializer.Serialize(instance, new JsonSerializerOptions
            {
                Converters = { new JsonStringEnumConverter() }
            });

            return(jsonText);
        }