Class JmsItemWriter<T>

java.lang.Object
org.springframework.batch.item.jms.JmsItemWriter<T>
All Implemented Interfaces:
ItemWriter<T>

public class JmsItemWriter<T> extends Object implements ItemWriter<T>
An ItemWriter for JMS using a JmsTemplate. The template should have a default destination, which will be used to send items in write(List).

The implementation is thread-safe after its properties are set (normal singleton behavior).
Author:
Dave Syer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.apache.commons.logging.Log
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setJmsTemplate(org.springframework.jms.core.JmsOperations jmsTemplate)
    Setter for JMS template.
    void
    write(List<? extends T> items)
    Send the items one-by-one to the default destination of the JMS template.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      protected org.apache.commons.logging.Log logger
  • Constructor Details

    • JmsItemWriter

      public JmsItemWriter()
  • Method Details

    • setJmsTemplate

      public void setJmsTemplate(org.springframework.jms.core.JmsOperations jmsTemplate)
      Setter for JMS template.
      Parameters:
      jmsTemplate - a JmsOperations instance
    • write

      public void write(List<? extends T> items) throws Exception
      Send the items one-by-one to the default destination of the JMS template.
      Specified by:
      write in interface ItemWriter<T>
      Parameters:
      items - items to be written
      Throws:
      Exception - if there are errors. The framework will catch the exception and convert or rethrow it as appropriate.
      See Also: