Azure / Azure/azure-functions-java-library

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

Open
#74 3 comments 2 reactions 0 assignees View on GitHub
area:java-functions
Dominant language
Java
Stars
45
Forks
49
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.