How to get Spring XD to deploy a predefined set of streams and taps on startup

你说的曾经没有我的故事 提交于 2020-01-01 05:25:13

问题


Is there a way to launch a set of steams and taps that have been defined when a new instance of spring xd is launched?

The scenario is this: We've done some prototyping on our dev systems, but now when we'd like to build and release this to a test team. We'd like to automate most of the background work and the user needs to just worry about the output from the streams and not have to worry about the streams or their definitions or their deployment.

To facilitate this is there any runtime configurations we can use?

UPDATE: Our current approach involves writing a shell script to make some rest calls to the Spring API to create and deploy the required streams.


回答1:


The shell maintains a log of user commands:

spring-shell.log

You can edit it after creating your stream(s) (or create a file with shell commands) and then use the script command:

xd:>script foo.xd

or

$ bin/xd-shell < foo.xd

(the .xd suffix is not required, the file name can be anything).

EDIT (comment below)...

This does come with the caveat that bin/xd-shell < foo.xd will run all commands regardless of success or failure, and xd-shell --cmdfile foo.xd will terminate execution with an exit code immediately should a command fail.



来源:https://stackoverflow.com/questions/24819401/how-to-get-spring-xd-to-deploy-a-predefined-set-of-streams-and-taps-on-startup

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!