SpringSource/spring-xd — pull request #64 by aclement (2013-06-10 18:35:20+00:00)
Title: xd-216: tap stream.module syntax

This syntax will work

tap .

This enables the following to work:

curl -X POST -d "http --port=9004 | transform --expression='new StringBuilder(payload).reverse()' | log" http://localhost:8080/streams/reverser

curl -X POST -d "tap reverser.transform | log" http://localhost:8080/streams/reverser2

Then when I do this:

curl -X POST -d "hello" http://localhost:9004

The container prints this (so both streams see the output of the transform).
11:30:10,757 WARN ThreadPoolTaskScheduler-1 logger.reverser:141 - olleh
11:30:10,760 WARN ThreadPoolTaskScheduler-1 logger.reverser2:141 - olleh

I could also write:

curl -X POST -d "tap @reverser.1 | log" http://localhost:8080/streams/reverser2

Without a StreamRepository the implementation is a bit dirty. Basically the parser becomes stateful maintaining a list of streams it has seen - and uses it to resolve stream.module references that occur in tap calls.

Note: I *think* this implementation means if you restart the admin component the tap syntax will stop behaving because the state in the parser will be lost.