spring-projects/spring-xd — pull request #1182 by dturanski (2014-09-16 15:25:45+00:00)
Title: XD-2118 provide a shell command processor

Implements a processor that can execute a shell command and stream data bi-directionally using stdin and stdout. For example, this may be used to execute a python script. The ShellCommandProcessor requires an AbstractByteArraySerializer (from SI ip). The module is currently configured to use ByteArrayCrLfSerializer.

Current constraints/assumptions

* The shell command must be written for streaming data. That is, stays open indefinitely and operates in a request/response style. See src/test/resources/echo.py. Currently to work in a stream, it must not write anything to stdout initially, only respond to data on stdin.

* The shell command must comply with the configured serializer to delimit the payload (e.g., '\r\n' for the ByteArrayCrLfSerializer). See src/test/resources/echo.py

* The processor currently produces and consumes String only

* Anything required for running the command must be available on the container to which the module is deployed (e.g. python installed)

This PR does not include integration tests, but I have tested manually across transports in singlenode with

stream create shelltest --definition "http | shell --command='python /extensions/spring-xd-extension-process/src/test/resources/echo.py' | log" --deploy