1
votes

I'm trying to construct a stream in spring cloud data flow with kafka-based scriptable transform. I followed the instruction here:
https://docs.spring.io/spring-cloud-stream-app-starters/docs/Celsius.SR2/reference/htmlsingle/#spring-cloud-stream-modules-scriptable-transform

and my stream definition looks like this:

:SCDF_SORUCE > scriptable-transformer --language=ruby --script="return ""#{payload} extended"";" > :SCDF_DESTINATION

The "scriptable-transformer" app is registered with the following uri:
maven://org.springframework.cloud.stream.app:scriptable‑transform‑processor‑kafka:2.0.0.RELEASE

When I tried to deploy the stream, I see the following error in my skipper log:

org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping
 in 'reader', line 13, column 5:
    "spring.metrics.export.triggers. ... 
    ^
expected <block end>, but found Scalar
 in 'reader', line 18, column 40:
     ... riptable-transformer.script": ""return ""#{payload} extended"";""
                                         ^
    at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:569) ~[snakeyaml-1.17.jar!/:na]

I've also tried to use js and python script, but got similar results.

How could I fix this error?

Here is a short summary of the scdf version being used:
- scdf local server: 1.5.2.RELEASE
- skipper server: 1.0.7.RELEASE

1

1 Answers

0
votes

I believe you are referring to the scriptable-transform (not scriptable-transformER) app? Anyway i've tried it and can confirm the issue when using the same transform expression in Skipper mode (expression works as it is in classic mode).

However if you replace the double with single quotes i believe it will resolve the issue. Following pipeline works fine for me with Kafka, Skipper:

time | scriptable-transform --scriptable-transformer.language=ruby --scriptable-transformer.script="return '#{payload} extended';" | log

I will investigate further to figure out if this is a documentation or code issue. In the meantime could you pleas try to above mention workaround and let me know if it solves to problem?

Thanks