Closed TsuyoshiUshio closed 5 years ago
"type" : "KafkaTriggerAttribute",
does not look right. type
needs to point to the binding type or trigger type.
Hi @pragnagopa In this case what is the binding type and trigger type?
binding type might be Kafka, right?
[Extension("Kafka", configurationSection: "kafka")]
public class KafkaExtensionConfigProvider : IExtensionConfigProvider
Then What is the trigger type? Where can I find it?
Right. binding type is kafka "type" : "Kafka"
Hi @pragnagopa
I tried Kafka however, the result was the same.
[04/22/2019 17:48:02] KafkaTrigger-Java: No trigger binding specified. A function must have a trigger input binding.
This is the function.json. How can I register the trigger bindings? How the code find out the list of the trigger bindings?
{
"scriptFile" : "../kafka-function-1.0-SNAPSHOT.jar",
"entryPoint" : "com.contoso.kafka.Function.run",
"bindings" : [ {
"type" : "Kafka",
"direction" : "in",
"name" : "kafkaEvents",
"topic" : "pageviews",
"consumerGroup" : "azfunc",
"brokerList" : "LocalBroker"
} ]
}
Hi @pragnagopa
I did some research. I read the code of azure-funcitons-host, I found the code for the BindingMetadata it says
public bool IsTrigger
{
get
{
return Type.EndsWith("trigger", StringComparison.OrdinalIgnoreCase);
}
}
Also, When I see the schema of the function.json, I can't find kafka trigger on schema.
http://json.schemastore.org/function
Do I need to register the trigger? Or In case of KafkaTriggerAttribute, then KafkaTrigger ? In case of SinaglR, they don't have a trigger.
Eventually, 'kafkaTrigger' works. It might be the name of KafkaTriggerAttribute'. The binding name should be something with 'trigger'. It also has other problem. I missed the installation of the DLL of the Extension. In this case it shows the same error message. In this case, I missed install the extension nuget packages. That is why I can't find the target dll on the bin folder. For the local installation the extension, this works for me.
func extensions install --source ~/Downloads/NuGet -p Microsoft.Azure.WebJobs.Extensions.Kafka --version 0.0.1-alpha
Problem
I have an extension it works on .NET side. I create a Java implementation using CustomBinding, I install the extension and execute Azure Functions with maven, then I encounter this issue. What is missing my configuration?
Configuration
My Trigger's definition is like this.
I tried to change the type for other type. the "KafkaTriggerAttirbute" is taken from the definition of IExtensionConfigProvider implementation of C#.
The function.json which is genareted by pacakge is
I also tried the same value of the type of C# function.json 's type. it was "kafkaTrigger" however, It doesn't work. It returns "[04/20/2019 18:27:40] KafkaTrigger-Java: The binding type(s) 'kafkaTrigger' are not registered. Please ensure the type is correct and the binding extension is installed." Any ideas?
Implementation of IExtensionConfigProvider
https://github.com/Azure/azure-functions-kafka-extension/blob/tsuyoshi/javaimpl/src/Microsoft.Azure.WebJobs.Extensions.Kafka/Config/KafkaExtensionConfigProvider.cs#L21
Java implementation
https://github.com/Azure/azure-functions-kafka-extension/blob/tsuyoshi/javaimpl/binding-library/java/src/main/java/com/microsoft/azure/functions/kafka/annotation/KafkaTrigger.java