add applications properties to Message Sent to Service bus (#4492)
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
This commit is contained in:
parent
1f014c9264
commit
60508d40b5
|
|
@ -52,6 +52,15 @@ public class SendMessage : CodeActivity
|
|||
/// The formatter to use when serializing the message body.
|
||||
/// </summary>
|
||||
public Input<Type?> FormatterType { get; set; } = default!;
|
||||
/// <summary>
|
||||
/// The application properties to embed with the Service Bus Message
|
||||
/// </summary>
|
||||
[Input(Category = "Advanced",
|
||||
DefaultSyntax = "Json",
|
||||
SupportedSyntaxes = new[] { "JavaScript", "Json" },
|
||||
UIHint = InputUIHints.MultiLine)
|
||||
]
|
||||
public Input<IDictionary<string, object>?> ApplicationProperties { get; set; } = default;
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override async ValueTask ExecuteAsync(ActivityExecutionContext context)
|
||||
|
|
@ -69,6 +78,9 @@ public class SendMessage : CodeActivity
|
|||
|
||||
// TODO: Maybe expose additional members?
|
||||
};
|
||||
if (context.Get(ApplicationProperties) != null)
|
||||
foreach (var property in context.Get(ApplicationProperties))
|
||||
message.ApplicationProperties.Add(property.Key, ((System.Text.Json.JsonElement)property.Value).GetString());
|
||||
|
||||
var client = context.GetRequiredService<ServiceBusClient>();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue