-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dapr pubsub service bus topics: Add support for including ApplicationProperties
in subscriber
#3428
Comments
Looking at the implementation of the component here:
it looks like the metadata is missing from the mapping when receiving a message from the bus |
Dapr supports pass through of non-cloud event properties if and only if are these sent as additional properties within a cloud event body. That is referred to as cloud event extension. It does not work with raw events, but instead a payload of type What you are requesting is not inherently Service Bus specific and this request occasionally comes up with other components. The Dapr PubSub component interface does not currently specify that metadata properties are to be retained. These were only created with the intentions to control component specific behavior but not to be delivered to the consumer application. Therefore, a larger proposal would be required to design an appropriate solution to store and deliver metadata in all Dapr pubsub components, even when cloud event envelopes are not used. I am not a fan of creating a component specific solution / approach here, especially given that we already support passing through custom data via cloud event extensions. |
Perhaps there is some confusion here based on wording of the request. The code you pointed out will take any unknown metadata properties and add them to:
components-contrib/common/component/azure/servicebus/message.go Lines 172 to 174 in f0be1a2
I think you are seeing the When this was designed, the intention there was never for those custom properties to be delivered back to the subscriber. We can certainly add support for this however. |
ApplicationProperties
in subscriber
What needs to be done is for this function be updated to also look at the components-contrib/common/component/azure/servicebus/message_pubsub.go Lines 56 to 109 in f0be1a2
That should give you what you want @vbuonagura and this change would apply to all Service Bus components in Dapr. |
I implemented this and you will see it in Dapr 1.14 |
Thanks @berndverst for taking the point. I will check it with Dapr 1.14 |
@berndverst is there a way to test the code change in preview mode? |
Hello,
we are trying to integrate Dapr within our microservices architectures but we are experiencing some issues in accessing custom properties for messaged published through Service Bus Topics.
We are not using cloudEvents and to make events traceable, we will leverage ElasticAPM with the default Azure Service Bus capabilities based on Diagnostic-Id field. See more here.
We are publishing the message from a .NET 8 API in the following way:
`
public async Task CreateNotification([FromBody] Notification notification)
{
if (notification is not null)
{
ITransaction transaction = Agent.Tracer.CurrentTransaction;
}`
The rawPayload and Diagnostic-Id metadata are correctly set into the message custom properties, but when we receive the data in the following way, we cannot see those metadata into the http request header
`Dapr.Topic("pubsub", "notification-topic")]
[HttpPost("notificationreceived")]
public async Task NotificationReceived([FromBody] Notification notification)
{
foreach (var header in Request.Headers)
{
_logger.LogInformation(header.Key + " = " + header.Value);
}
}`
the only metadata available are:
Is there a way to get also custom properties with metadata?
The text was updated successfully, but these errors were encountered: