question

SHRIRANGPINJARKAR-5271 avatar image
0 Votes"
SHRIRANGPINJARKAR-5271 asked SHRIRANGPINJARKAR-5271 published

classCastException: Cannot convert RpcHttpRequestDataSource to type HttpRequestMessage<Optional<EventGridEvent>>

I am implementing claim check cloud pattern using Java Azure function, event grid and blob storage. I have implemented this in C# dot net core. It worked like a charm but when used java got the above issue.
I have created an issue on GitHub and also provided the entire code. Please take a look. I am not able to find anything on the internet.

Issue created: https://github.com/Azure/azure-functions-java-worker/issues/477.

I am getting the below error when posting requests locally and on azure as well.

Check my code https://github.com/Shrirang97/java-design-patterns/blob/claim-check-pattern-azure/claim-check-pattern/Call%20Usage%20App/src/main/java/com/iluwatar/producer/calldetails/functions/UsageDetailPublisherFunction.java

Executed 'Functions.UsageDetailPublisherFunction' (Failed, Id=475b0106-0d71-4e23-a7b4-edb885a599e8, Duration=239ms) [2021-10-25T16:26:05.414Z] System.Private.CoreLib: Exception while executing function: Functions.UsageDetailPublisherFunction. System.Private.CoreLib: Result: Failure [2021-10-25T16:26:05.414Z] Exception: ClassCastException: Cannot convert com.microsoft.azure.functions.worker.binding.RpcHttpRequestDataSource@20d8cd31to type com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<com.azure.messaging.eventgrid.EventGridEvent>> [2021-10-25T16:26:05.414Z] Stack: java.lang.ClassCastException: Cannot convert com.microsoft.azure.functions.worker.binding.RpcHttpRequestDataSource@20d8cd31to type com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<com.azure.messaging.eventgrid.EventGridEvent>> [2021-10-25T16:26:05.414Z] at com.microsoft.azure.functions.worker.binding.DataOperations.generalAssignment(DataOperations.java:191) [2021-10-25T16:26:05.414Z] at com.microsoft.azure.functions.worker.binding.DataOperations.apply(DataOperations.java:120) [2021-10-25T16:26:05.414Z] at com.microsoft.azure.functions.worker.binding.DataSource.computeByType(DataSource.java:56) [2021-10-25T16:26:05.414Z] at com.microsoft.azure.functions.worker.binding.RpcHttpRequestDataSource.computeByType(RpcHttpRequestDataSource.java:20) [2021-10-25T16:26:05.414Z] at com.microsoft.azure.functions.worker.binding.DataSource.computeByName(DataSource.java:42) [2021-10-25T16:26:05.415Z] at com.microsoft.azure.functions.worker.binding.RpcHttpRequestDataSource.computeByName(RpcHttpRequestDataSource.java:20)


azure-functions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers