spring-projects/spring-xd — pull request #620 by ilayaperumalg (2014-03-03 17:38:25+00:00)
Title: XD-885 Register job listeners

- Register XD BatchJob listeners automatically
- Register `jobExecution`, `stepExecution`, `chunk`, `item` and `skip` listeners
automatically when the job module is deployed by setting the corresponding
job and step parser factory beans with jobExecution listeners and step listeners

XD-1362

- Make all the listeners to use pub/sub notification channels
- Created `pub/sub` notification channels
- Created a generic BatchJobListener that sends the payload to the pub/sub
notification channels and make all the XD BatchJob listeners extend this.

- Created JobNotification plugin
- Created JobNotification plugin that binds/unbinds the notification channels
to/from the messagebus with named channels. The named channels created are:
`topic:job:myjobname-jobExecution`
`topic:job:myjobname-stepExecution`
`topic:job:myjobname-chunk`
`topic:job:myjobname-item`
`topic:job:myjobname-skip`
- Fixed StreamConfigParser to return a valid pub/sub named channel name for the job
notification channel mentioned above. Before that, the StreamConfigParser removes the
"topic:" prefix before creating the ChannelNode; this causes the check to verify if
the channel is pub/sub fails isChannelPubSub(channelName).

XD-1363

- To be able to tap job output channel
- Created direct channel `output` for job module
- Have JobLaunchingMessageHandler's `reply` channel set to use this channel
- Similar to StreamPlugin, created `wiretap` on this output channel when this gets bound to the messagebus
- Tap channel name for the job module would have similar syntax as that for the stream
`tap:job:myjobname`
- To comply this, had to change the job input channel name to be `queue:job:myjobname-input`

- Refactored Plugins
- Created JobPartitioner Plugin that does the binding/unbinding operations on
partitioner channels to/from messagebus.
- Created AbstractMessageBusBinderPlugin that shares common methods related to
binding/unbinding producer(s) and consumer(s) to message bus.
- Have Stream, Job, JobNotification and JobPartitioner Plugins extend this.
- Assigned the highest precedence to Stream/Job Plugins so that their lifecycle methods
would always run prior to other plugins (Just in case if any of the other plugins might
depend on them)