he source will generate random inputs with a specified pattern.
# cd $kuiper_src
# go build --buildmode=plugin -o plugins/sources/Random.so plugins/sources/random.go
# cp plugins/sources/Random.so $kuiper_install/plugins/sources
Restart the Kuiper server to activate the plugin.
The configuration for this source is $kuiper/etc/sources/random.yaml
. The format is as below:
default:
interval: 1000
pattern:
count: 50
ext:
interval: 300
seed: 1
Use can specify the global random source settings here. The configuration items specified in default
section will be taken as default settings for the source when running this source.
The interval (ms) to issue a message.
The maximum integer to be produced by the random function
The pattern to be generated by the source. In the above example, the pattern will be a json like {"count":50}
If you have a specific connection that need to overwrite the default settings, you can create a customized section. In the previous sample, we create a specific setting named with test
. Then you can specify the configuration with option CONF_KEY
when creating the stream definition (see stream specs for more info).
demo (
...
) WITH (DATASOURCE="demo", FORMAT="JSON", CONF_KEY="ext", TYPE="random");
The configuration keys "ext" will be used.