You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom metadata properties set for a message published using DaprClient are made available to subscribers of this message.
Actual Behavior
Custom metadata properties are not available from Http headers or otherwise.
Steps to Reproduce the Problem
My dapr components are set up with Azure Container Apps, so there may be a limitation I am unaware of
I am using Asp.net for this for the most part, with DaprClient used to publish and TopicAttribute to define subscriptions within the controllers.
Due to some complexity with our application, I use Terraform to actually set up the subscriptions, with disableEntityManagement set to true to prevent Dapr setting up the subscriptions itself (perhaps I've missed something key here)
With Azure Service Bus Topics, I can set custom metadata properties using the DaprClient on publish:
var metadata = new Dictionary<string, string>
{
{"cloudevent.type", eventType},
{"eventName", eventName}
};
//@event refers to a class object
await daprClient.PublishEventAsync("pubsubName", "topicName", @event, metadata, ct);
I have a controller with endpoints decorated using the TopicAttribute, like below:
[HttpPost]
[Route("handle")]
[Topic("pubsubName", "topicName")]
public async Task<Result> HandleMessageAsyncJsonDocument @event, [FromHeader(Name="eventName")]string eventName)
{
logger.LogInformation($"EventName: {eventName}");
var context = contextAccessor.HttpContext;
if (context is null)
{
logger.LogInformation($"Could not retrieve HttpContext");
}
else
{
foreach(var header in context.Request.Headers)
{
logger.LogInformation($"Header: {header.Key} - {header.Value}");
}
}
return Result.Error();
}
However, whether it's by the FromHeader property or the HttpContext itself, these custom properties, I believe referred to as ApplicationProperties in Azure Service Bus, are not made available.
Release Note
RELEASE NOTE:
The text was updated successfully, but these errors were encountered:
Expected Behavior
Custom metadata properties set for a message published using DaprClient are made available to subscribers of this message.
Actual Behavior
Custom metadata properties are not available from Http headers or otherwise.
Steps to Reproduce the Problem
DaprClient
used to publish andTopicAttribute
to define subscriptions within the controllers.disableEntityManagement
set to true to prevent Dapr setting up the subscriptions itself (perhaps I've missed something key here)With Azure Service Bus Topics, I can set custom metadata properties using the DaprClient on publish:
I have a controller with endpoints decorated using the TopicAttribute, like below:
However, whether it's by the FromHeader property or the HttpContext itself, these custom properties, I believe referred to as ApplicationProperties in Azure Service Bus, are not made available.
Release Note
RELEASE NOTE:
The text was updated successfully, but these errors were encountered: