public class SimpleFileReceiver extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SimpleFileReceiver.MessageProcessing |
| Modifier and Type | Field and Description |
|---|---|
protected com.rabbitmq.client.QueueingConsumer |
consumer |
protected static long |
DEFAULT_TIMEOUT |
protected int |
errorCount |
protected ExecutorService |
executor |
protected Map<String,FileReceiveState> |
fileStates |
private static org.slf4j.Logger |
LOGGER |
protected RabbitQueue |
queue |
protected boolean |
terminated |
protected long |
waitingForMsgTimeout |
| Modifier | Constructor and Description |
|---|---|
protected |
SimpleFileReceiver(RabbitQueue queue,
com.rabbitmq.client.QueueingConsumer consumer) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
close() |
static SimpleFileReceiver |
create(RabbitQueue queue) |
static SimpleFileReceiver |
create(RabbitQueueFactory factory,
String queueName) |
void |
forceTermination() |
int |
getErrorCount() |
protected void |
increaseErrorCount() |
String[] |
receiveData(String outputDirectory) |
void |
setWaitingForMsgTimeout(long waitingForMsgTimeout) |
void |
terminate() |
private static final org.slf4j.Logger LOGGER
protected static final long DEFAULT_TIMEOUT
protected RabbitQueue queue
protected com.rabbitmq.client.QueueingConsumer consumer
protected Map<String,FileReceiveState> fileStates
protected boolean terminated
protected int errorCount
protected ExecutorService executor
protected long waitingForMsgTimeout
protected SimpleFileReceiver(RabbitQueue queue, com.rabbitmq.client.QueueingConsumer consumer)
public static SimpleFileReceiver create(RabbitQueueFactory factory, String queueName) throws IOException
IOExceptionpublic static SimpleFileReceiver create(RabbitQueue queue) throws IOException
IOExceptionpublic String[] receiveData(String outputDirectory) throws IOException, com.rabbitmq.client.ShutdownSignalException, com.rabbitmq.client.ConsumerCancelledException, InterruptedException
IOExceptioncom.rabbitmq.client.ShutdownSignalExceptioncom.rabbitmq.client.ConsumerCancelledExceptionInterruptedExceptionpublic void terminate()
public void forceTermination()
protected void increaseErrorCount()
public int getErrorCount()
public void setWaitingForMsgTimeout(long waitingForMsgTimeout)
protected void close()
Copyright © 2017–2018. All rights reserved.