CosmosDB Outputbinding does not work for multiple documents
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the Java function with EventHubTrigger Cardinality.MANY and CosmosDBOutput using OutputBinding<List>. Trace how the Java CosmosDB output binding handles outputDocument.setValue(messages), and compare its behavior with the documented .NET and JavaScript support. Done means identifying whether multiple documents are supported in Java and recording or correcting the resulting behavior.
Written by the indexing model from the issue text.
Description
We have a simple function which is triggered by event hub and simply forwards messages to cosmosDB using the cosmosDB output binding.
It works well if we receive and forward one message.
However it does not work when we receive and forward a list of messages using Cardinality.many.
Example:
public void run(
@EventHubTrigger(
name = "ConsumeDeviceMessages2",
eventHubName = "@eventhub.name@",
connection = "@iothub.connection@",
consumerGroup = CONSUMER_GROUP,
cardinality = Cardinality.MANY)
List<String> messages,
@CosmosDBOutput(
name = "outputDocument",
databaseName = "@cosmosdb.name@",
collectionName = "@cosmosdb.collection.name@",
connectionStringSetting = "@cosmosdb.connection.appsetting@")
OutputBinding<List<String>> outputDocument,
final ExecutionContext context) {
outputDocument.setValue(messages);
}
If this is triggered an error occurs:
[Error] Executed 'Functions.SaveIotDeviceMessages' (Failed, Id=a845d74b-861a-40e7-a6f2-f5b7032b2cf2)Value cannot be null.Parameter name: document
Configuration seems pretty basic and works on another function where we forward multiple messages to a queue instead.
Any idea why it is not working for cosmosDB? The documentation states its working for .NET and Javascript, no information about Java though.
Thanks and regards.
- Dominant language
- Java
- Stars
- 45
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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-library
-
area:java-functions
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Azure/azure-functions-java-library#229 · 1 comment ·
-
area:java-functions
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Azure/azure-functions-java-library#222 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
area:java-functions
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
area:java-functions
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in Azure/azure-functions-java-library
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenAPITools/openapi-generator#25014 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
AloisSeckar/demos-java#380 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openhab/openhab-core#5847 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
appsmithorg/appsmith#42297 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100