Spring Cloud 数据流 Python 脚本处理器不起作用

问题描述

我正在尝试使用文件构建一个简单的流管道 |脚本|文件 我选择python作为脚本语言 如何在数据流 UI 中编写长 python 脚本? 我想通过在 UI 中给出来执行的代码

def input():
    return "Pre" + payload;

def output():
    return payload + "Post";

result = locals()[channel]()

约定是什么?

我收到 TokenizationError:UnExpectedChar 错误。如果尝试转义空格字符,我会在执行过程中遇到分隔符异常

See the Error and PipeLine On Data Flow UI Adding Python Script Here as it is

解决方法

您是否看过示例 here,其中展示了如何在 SCDF 流/任务中使用 Python 应用程序