Azure / Azure/azure-functions-java-library

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

オープン
#74 コメント 3 件 リアクション 2 件 担当者 0 名 GitHub で見る
area:java-functions
主要言語
Java
スター
45
フォーク
49
PR マージ指標
30日以内にマージされた PR はありません

説明

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?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず、レポートで言及されている @EventHubTrigger パラメーターのバインディングと HttpResponseMessage インターフェースを調査します。Gson のデシリアライズ失敗を再現し、その後、サポートされている動作またはドキュメントで、@HttpTrigger から書き込まれたメッセージをどのように消費できるかを説明すべきか判断します。完了には、明確でテスト済みの解決が必要です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
azure, java
領域
api, backend
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。