Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Using standalone class is straightforward:
instantiate the FileWritingMessageHandler with a directory
location where the files will be written. The code snippet is shown
below:
// set the directory
File directory = new File("/Users/mkonda/dev/ws/tmp");
..
private void startStandaloneWriter() {
// fetch the channel for incoming feed
outChannel = ctx.getBean("files-channel",
PublishSubscribeChannel.class);
handler = new FileWritingMessageHandler(directory);
// subscribe to the incoming feed
outChannel.subscribe(handler);
}
You have to submit this handler to the channel so messages will be passed onto this event handler.