Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

CosmosDB Outputbinding does not work for multiple documents

Đang mở
#109 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
databases

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện hàm Java với EventHubTrigger Cardinality.MANY và CosmosDBOutput bằng OutputBinding<List>. Theo dõi cách output binding CosmosDB của Java xử lý outputDocument.setValue(messages), rồi so sánh hành vi của nó với phần hỗ trợ .NET và JavaScript được ghi trong tài liệu. Hoàn thành khi xác định được Java có hỗ trợ nhiều tài liệu hay không và ghi lại hoặc sửa hành vi phát sinh.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:java-functions

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.

Ngôn ngữ chính
Java
Star
45
Fork
49
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Azure/azure-functions-java-library

Tất cả issue của Azure/azure-functions-java-library

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.