Skip to content
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

Event Hub binding should allow transforming ALL custom properties as headers, not just iot-hub systemproperties #3570

Open
oising opened this issue Oct 16, 2024 · 0 comments
Labels
kind/enhancement New feature or request

Comments

@oising
Copy link

oising commented Oct 16, 2024

Describe the feature

Currently only a fixed set of system properties from Azure IoT Hub are forwarded as headers when delivered to a subscriber. The Azure Event Hubs binding should expose a getAllProperties property (false by default) to forward all user/app/custom properties from the Event Hub message as headers to the subscriber.

It seems that is 90% supported already in the DAPR codebase, but it stops short at exposing the setting in the manifest. i.e.

// GetBindingsHandlerFunc returns the handler function for bindings messages
func (aeh *AzureEventHubs) GetBindingsHandlerFunc(topic string, getAllProperties bool, handler bindings.Handler) HandlerFn {
	return func(ctx context.Context, messages []*azeventhubs.ReceivedEventData) ([]HandlerResponseItem, error) {
		if len(messages) != 1 {
			return nil, fmt.Errorf("expected 1 message, got %d", len(messages))
		}

		bindingsMsg, err := NewBindingsReadResponseFromEventData(messages[0], topic, getAllProperties)
		if err != nil {
			return nil, fmt.Errorf("failed to get bindings read response from azure eventhubs message: %w", err)
		}

		aeh.logger.Debugf("Calling app's handler for message %s on topic %s", messages[0].SequenceNumber, topic)
		_, err = handler(ctx, bindingsMsg)
		return nil, err
	}
}

Release Note

RELEASE NOTE:

@oising oising added the kind/enhancement New feature or request label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant