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

Need to include properties with body #3

Open
WilliamBradee opened this issue Dec 7, 2023 · 0 comments
Open

Need to include properties with body #3

WilliamBradee opened this issue Dec 7, 2023 · 0 comments

Comments

@WilliamBradee
Copy link

Azure event hub allows sending properties along with the body.

See JavaScript example at https://learn.microsoft.com/en-us/azure/event-hubs/add-custom-data-event

this is the essence from that link:

let eventData = { body: "First event", properties: { "event-type": "com.microsoft.samples.hello-event", "priority": 1, "score": 9.0 } };

Allow msg.properties and if they are there, add them when the message is built.

I tested this in line 101 of index.js

const isAdded = batch.tryAdd(msg.properties === undefined ? { body: msgJSON } : {body: msgJSON, properties : msg.properties});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant