Skip to main content

Item Writers

  • Chapter
Pro Spring Batch
  • 577 Accesses

Abstract

It’s amazing what computers can do. The numbers they can crunch. The images they can process. Yet it doesn’t mean a thing unless the computer can communicate what it has done via its output. ItemWriters are the output facility for Spring Batch. And when you need a format to output the results of the Spring Batch process, Spring Batch delivers. In this chapter, you look at the different types of ItemWriters provided by Spring Batch as well as how to develop ItemWriters for situations that are more specific to your needs. Topics discussed include the following:

  • Introduction to ItemWriters: Similar to the ItemReaders at the other end of step execution, ItemWriters have their own special nuances. This chapter talks about how ItemWriters work from a high level.

  • File-based ItemWriters: File-based output is the easiest method to set up and is one of the most common forms used in batch processing. Because of this, you begin your exploration of ItemWriters by looking at writing to flat files as well as XML files.

  • Database ItemWriters: The relational database is king in the enterprise when it comes to data storage. However, databases create their own unique challenges when you’re working with high volumes of data. You look at how Spring Batch handles these challenges with its unique architecture.

  • Alternative output destination ItemWriters: Files and databases aren’t the only media to which enterprise software outputs. Systems send e-mails, write to JMS endpoints, and save data via other systems. This section looks at some of the less common but still very useful output methods that Spring Batch supports.

  • Multipart ItemWriters: Unlike reading, where data typically comes from a single source, it’s common to send output to multiple sources. Spring Batch provides ways to write to multiple systems as well as structure a single ItemWriter as a collaborative effort of multiple ItemWriters. This section looks at ItemWriters tasked with working with either multiple resources or multiple output formats.

  • Statement writers: This chapter finishes the development of the statement job by implementing the required writers for each step.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Michael T. Minella

About this chapter

Cite this chapter

Minella, M.T. (2011). Item Writers. In: Pro Spring Batch. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-3453-1_9

Download citation

Publish with us

Policies and ethics