public class SerializationAwareQueueProducer<T> extends Object implements org.mule.runtime.core.api.streaming.iterator.Producer<T>
Producer that reads arrays of byte from a Queue and then uses a
ObjectSerializer to deserialized those bytes into an object. A polling timeout value might be specified, otherwise the
default value of 5000 milliseconds will be assumed| Constructor and Description |
|---|
SerializationAwareQueueProducer(org.mule.runtime.core.api.util.queue.Queue queue,
org.mule.runtime.api.serialization.ObjectSerializer serializer)
Creates an instance with 5000 milliseconds as the default polling value
|
SerializationAwareQueueProducer(org.mule.runtime.core.api.util.queue.Queue queue,
org.mule.runtime.api.serialization.ObjectSerializer serializer,
long timeout) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
getSize() |
T |
produce()
This implementation will poll from the queue once and will return the obtained item.
|
public SerializationAwareQueueProducer(org.mule.runtime.core.api.util.queue.Queue queue,
org.mule.runtime.api.serialization.ObjectSerializer serializer)
queue - the queue to stream fromserializer - the ObjectSerializer to be used when accessing the Queuepublic SerializationAwareQueueProducer(org.mule.runtime.core.api.util.queue.Queue queue,
org.mule.runtime.api.serialization.ObjectSerializer serializer,
long timeout)
public T produce()
null is returned. If the poll method throws
InterruptedException then null is returned as wellproduce in interface org.mule.runtime.core.api.streaming.iterator.Producer<T>public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic int getSize()
getSize in interface org.mule.runtime.api.streaming.HasSizeCopyright © 2006–2022 MuleSoft, Inc.. All rights reserved.