问题描述
尝试将函数运行器部署到 scdf k8s 中
Trying to deploy into scdf k8s a function-runner into a stream
http --server.port=9001 | f-run: function-runner --function.className=com.example.functions.CharCounter --class-name=com.example.functions.CharCounter --location="maven://io.spring.sample:function-sample:jar:1.0.2" | log
我已经使用 function-runner-kafka 1.1.0.M1
创建了一个 docker 镜像.
I've create a docker image using function-runner-kafka 1.1.0.M1
.
总是得到:
***************************
APPLICATION FAILED TO START
***************************
Description:
Binding to target org.springframework.cloud.stream.app.function.app.FunctionProperties@264f218 failed:
Property: function.className
Value: null
Reason: may not be empty
Action:
Update your application's configuration
进入流定义,如何将maven
uri设置为function-jar
?
Into stream definition, how can i set the maven
uri to the function-jar
?
我想将带有 jar 代码的函数运行器运行到 scdf k8s 中
I wanna run function-runner with jar code into a scdf k8s
推荐答案
不推荐使用 function-runner
模型,取而代之的是 Spring Cloud Stream 中可用的原生 Spring Cloud Function 集成.
The function-runner
model is deprecated in favor of native Spring Cloud Function integration available in Spring Cloud Stream.
您可以简单地使用 @Bean
函数构建 Spring Cloud Stream 应用程序,并将它们作为链的一部分作为功能流的一部分或在运行时解析为单个函数.
You can simply build a Spring Cloud Stream application with just function @Bean
's and have them part of the functional flow as a chain or resolved as an individual function at runtime.
参见 参考.指南了解更多详情.
一旦您拥有具有多个功能 @Bean
的应用程序,您还可以将它们与其他 App Starter 组合在一起,并在 SCDF DSL 中使用它.
Once when you have an application with multiple function @Bean
's, you also have the ability to compose them with other App Starters and use it in the SCDF DSL, too.
参考这个有关此主题的博客了解更多背景信息.
Refer to this blog on this subject for more background.
这篇关于scdf 1.7.3 docker k8s 功能运行程序未启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!