I'm attempting to trigger a Kubeless function (written as a Java method) and it doesn't seem to be working. I've tried everything I can think to try, but I've run out of ideas. Below is the Java method (it's basically an echo service, for now).
package io.kubeless;
import io.kubeless.Context;
import io.kubeless.Event;
public class MyHandler {
public String handle(Event event, Context context) {
return event.Data;
}
}
The method was deployed using the following:
$ kubeless function deploy my-handler --runtime java1.8 --handler MyHandler.handle --from-file src/main/java/io/kubeless/MyHandler.java
I have verified it works by running the following:
$ kubeless function call my-handler --data "It works"
$ kubectl logs my-handler-6f67d567c5-r8cdb
0 [pool-1-thread-38] INFO io.kubeless.Handler - Response: It works
I then created a Kafka trigger and published a message to it using the following.
$ kubeless trigger kafka create test --function-selector created-by=kubeless,function=my-handler --trigger-topic test-topic
$ kubeless topic publish --topic test-topic --data "Hello from Kafka"
$ kubectl logs my-handler-6f67d567c5-r8cdb
0 [pool-1-thread-38] INFO io.kubeless.Handler - Response: It works
As you can see, the only log entry is the one from the initial call that wasn't triggered by a Kafka pub/sub. I have verified the trigger exists:
$ kubeless trigger kafka ls
NAME NAMESPACE TOPIC FUNCTION SELECTOR
test default test-topic function=my-handler
As far as I can tell, Kafka seems to be running (I've also checked the Kafka logs, to no avail):
$ kubectl get pods --namespace=kubeless
NAME READY STATUS RESTARTS AGE
kafka-0 1/1 Running 0 170m
kafka-trigger-controller-f6f7c699f-m6mcd 1/1 Running 0 170m
kubeless-controller-manager-59d484f4d-9wlhq 3/3 Running 10 4d22h
zoo-0 1/1 Running 0 170m
Why is publishing not triggering the function? Any suggestions are appreciated and I thank you in advance.
所有评论(0)