Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

File Adapters > Standalone File Adapters

Standalone File Adapters

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.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial