azure-functions-kafka-extension icon indicating copy to clipboard operation
azure-functions-kafka-extension copied to clipboard

Avro deserialization using dotnet out-of-process execution model

Open undrivendev opened this issue 3 years ago • 2 comments

Hi, when using the out-of-process execution model we are referencing the Microsoft.Azure.Functions.Worker.Extensions.Kafka NuGet package, as outlined by this sample project file.

The problem is that all the Avro deserialization capabilities described in the README seems to not be available by following this route, because the corresponding types/assemblies are not referenced. If we go with the in-process model, we are referencing the Microsoft.Azure.WebJobs.Extensions.Kafka NuGet package which has all that we need for the Avro deserialization.

2

1

Is this really the case? If so, don't you think that it would be helpful to highlight in the docs the fact that we are losing quite a bit of functionality by going with the out-of-process execution model?

Thanks.

undrivendev avatar Aug 30 '22 09:08 undrivendev

Hi @undrivendev, Microsoft.Azure.Functions.Worker.Extensions.Kafka NuGet internally uses this project. If you build the dotnet out-of-proc function app, you will be able to see all Confluent dlls inside .azurefunctions folder.

krishna-kariya avatar Sep 12 '22 08:09 krishna-kariya

Hi @krishna-kariya, thanks for your reply, but it doesn't answer the question unfortunately.

Let me explain it more clearly.

If I run the example from here when using the out-of-process execution model, the code doesn't compile.

That's because the out-of-process Azure Functions Kafka extensions NuGet package does not include the necessary classes/interfaces like ISpecificRecord or GenericRecord.

So, how can I run that example by using the out-of-process execution model?

Thanks.

undrivendev avatar Sep 16 '22 13:09 undrivendev

Hi @krishna-kariya, thanks for your reply, but it doesn't answer the question unfortunately.

Let me explain it more clearly.

If I run the example from here when using the out-of-process execution model, the code doesn't compile.

That's because the out-of-process Azure Functions Kafka extensions NuGet package does not include the necessary classes/interfaces like ISpecificRecord or GenericRecord.

So, how can I run that example by using the out-of-process execution model?

Thanks.

For dotnet worker we don't supports ISpecificRecord, we only support the GenericRecord.

shrohilla avatar Nov 07 '22 11:11 shrohilla

Hi @shrohilla , thanks for the reply.

The Microsoft.Azure.Functions.Worker.Extensions.Kafka package only depends on Microsoft.Azure.Functions.Worker.Extensions.Abstractions.

In order to use the GenericRecord class there should be also reference to Apache.Avro in the dependency graph, and there's not.

It seems that you don't support it.

Or am I missing something?

Thanks.

undrivendev avatar Nov 08 '22 18:11 undrivendev

@undrivendev we don't support it directly, you need to specify your schema in AvroSchema attribute of the KafkaTrigger annotation. You will receive the object in serialized string not in GenericRecord. Kafka Extension take care of deserialization.

For reference you can see this e.g. of Java

shrohilla avatar Nov 09 '22 03:11 shrohilla

@undrivendev I hope this issue is resolved, feel free to reach out, closing this issue for now.

shrohilla avatar Dec 03 '22 12:12 shrohilla