public class AmqpItemReader<T> extends java.lang.Object implements ItemReader<T>
AMQP ItemReader
implementation using an AmqpTemplate
to
receive and/or convert messages.
Constructor and Description |
---|
AmqpItemReader(org.springframework.amqp.core.AmqpTemplate amqpTemplate)
Initialize the AmqpItemReader.
|
Modifier and Type | Method and Description |
---|---|
T |
read()
Reads a piece of input data and advance to the next one.
|
void |
setItemType(java.lang.Class<? extends T> itemType)
Establish the itemType for the reader.
|
public AmqpItemReader(org.springframework.amqp.core.AmqpTemplate amqpTemplate)
amqpTemplate
- the template to be used. Must not be null.public T read()
ItemReader
null
at the end of the input
data set. In a transactional setting, caller might get the same item
twice from successive calls (or otherwise), if the first call was in a
transaction that rolled back.read
in interface ItemReader<T>
null
if the data source is
exhaustedpublic void setItemType(java.lang.Class<? extends T> itemType)
itemType
- class type that will be returned by the reader.