Service Bus OutputBinding doesn't support ServiceBusMessage type with Metadata
@shreyas-gopalakrishna is already working on this.
Since Feb 24, 2023.
Assessment
This issue has not been assessed yet.
Description
There doesn't appear to be equivalent functionality for setting ServiceBusMessage Metadata in the Java worker. Compare with the C# documentation: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus-output?tabs=in-process%2Cextensionv5&pivots=programming-language-csharp#usage
Use the ServiceBusMessage type when sending messages with metadata. Parameters are defined as return type attributes. Use an ICollector or IAsyncCollector to write multiple messages. A message is created when you call the Add method.
Is there no equivalent in Java?
Repro steps
Provide the steps required to reproduce the problem:
- Create an Azure Function.
- Add azure-messaging-servicebus dependency to project.
- Add a
@ServiceBusTopicOutput bindingof typeOutputBinding<ServiceBusMessage>. - Create a
ServiceBusMessage msg = new ServiceBusMessage("message body")object. - Set some metadata via
sbMessage.getApplicationProperties().put("foo","bar"). - call
.setValue(msg)on the output binding. - Run the function.
Expected behavior
A message is added to the Service Bus topic with a body of "message body" and custom metadata of "foo": "bar".
Actual behavior
The resulting message body on the topic is a ServiceBusMessage serialized as a POJO object. Custom metadata is missing.
Known workarounds
Use a ServiceBusSenderClient instead of output bindings.
Related information
- Dominant language
- Java
- Stars
- 103
- Forks
- 74
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/azure-functions-java-worker
-
[Feature] Support raw Kafka record (KafkaRecord) binding with Protobuf deserializationPossibly taken @TsuyoshiUshio claimed this 165 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 50/100
-
[Feature] Support for reverse propagation of request telemetry tagsPossibly taken @arnabnandy7 claimed this 59 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
[Feature] Support OpenTelemetry BaggagePossibly taken @arnabnandy7 claimed this 59 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
mcp-extension
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Add advanced MCP tool samplesMay be free again @ahmedmuhsin claimed this 174 days ago, and no pull request is open. Openmcp-extension
Azure/azure-functions-java-worker#863 · 1 assignee ·
All issues in Azure/azure-functions-java-worker
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Make branch and label autocomplete matching locale-independentPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
jenkinsci/gitlab-plugin#1950 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
commons-app/apps-android-commons#6984 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
It's not necessary to copy the memory block in the readWrite() of org.h2.store.fs.mem.FileMemDataOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
h2database/h2database#4435 ·
Maintainers usually reply within 1 day