Closed demorgi closed 5 months ago
@demorgi I just remembered the following: wouldn't the current CustomHeaders
property in AzureServiceBusOptions
solve this issue without the need of extra code? Please check it here.
@demorgi I just remembered the following: wouldn't the current
CustomHeaders
property inAzureServiceBusOptions
solve this issue without the need of extra code? Please check it here.
@mviegas Correct me if I'm wrong but CustomHeaders are for inbound messages, just to support for other publishers outside of CAP (e.g. mass transit publishes a message, so now we need to configure CustomHeaders to injest it)
Here we are adding headers to outbound.
You're completely right, it's been a while since I touched this feature. Apologies for the confusion.
LGTM
I don't think this is a good feature. In our case, we need to add a dynamic TenantId as a header in each message. This new Option cannot achieve this. I think this requires the user to wrap Publish to add additional header information. Taking a step back, we need to provide a AOP feature for Publish similar to SubscribeFilter?
@yang-xiaodong Let me explain it a little bit differently, so there are 2 ways you can get data to populate headers:
@yang-xiaodong thoughts? (If you haven't change your mind regarding this feature, we should close this PR)
@demorgi I want to add a filter or something to support this feature in the future version, thanks for your PR!
Description:
A case when you need to add specific custom header to each message - it's not possible at the moment. Added
DefaultPublishHeaders
dictionary that gets added to all published messages.Changes:
DefaultPublishHeaders
dictionary to CAP.OptionsCapPublisher.Default
collection gets added to headers, existing headers are never overridenAffected components:
ICapPublisher.Default
Checklist:
Reviewers:
@yang-xiaodong @mviegas