Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

spring-xd

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.

like image 508
Arun Jose Avatar asked Jul 18 '14 07:07

Arun Jose


1 Answers

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.

like image 156
Gary Russell Avatar answered Nov 15 '22 21:11

Gary Russell