Azure / Azure/azure-functions-java-library

@EventHubTrigger cannot deserialize HttpResponseMessage. What is best way to deserialize HttpResponseMessage?

Đang mở
#74 3 bình luận 2 reaction 0 người được giao Xem trên GitHub
area:java-functions
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

Mô tả

I have a function(@HttpTrigger) which writes HttpResponseMessage to email topic. I am trying to create another function(@EventHubTrigger) to read message from this topic.

````
@FunctionName("EventHubTrigger-EmailCurated")
public void run(
@EventHubTrigger(name = "httpResponseMessage", eventHubName = "email", connection = "AzureEventHubConnection") HttpResponseMessage httpResponseMessage,
final ExecutionContext context) {
logger = context.getLogger();
logger.info("EventHubTrigger-EmailCurated received a httpResponseMessage : " + httpResponseMessage);
}
````
````
Stack: java.lang.RuntimeException: Unable to invoke no-args constructor for interface com.microsoft.azure.functions.HttpResponseMessage. Registering an InstanceCreator with Gson for this type may fix this problem.
Caused by: java.lang.UnsupportedOperationException: Interface can't be instantiated! Interface name: com.microsoft.azure.functions.HttpResponseMessage
````
I understand HttpResponseMessage is an interface. Is there any implementation class available that I can cast to?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu bằng cách kiểm tra việc liên kết tham số @EventHubTrigger và giao diện HttpResponseMessage được đề cập trong báo cáo. Tái hiện lỗi giải tuần tự Gson, sau đó xác định liệu hành vi được hỗ trợ hay tài liệu có nên giải thích cách sử dụng các message được ghi từ một @HttpTrigger hay không; công việc chỉ được xem là hoàn thành khi có một giải pháp rõ ràng và đã được kiểm thử.

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

Đánh giá

Công nghệ
azure, java
Lĩnh vực
api, backend
Loại issue
Lỗi
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
20/100

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.