Package org.hobbit.core.rabbit
Class SimpleFileSender
java.lang.Object
org.hobbit.core.rabbit.SimpleFileSender
- All Implemented Interfaces:
Closeable,AutoCloseable
A simple class that can be used to send files, i.e., small or large sized
data with a single name, via RabbitMQ using a queue with the given name. A
message created by this implementation comprises the following data
- int length of file name
- byte[] file name
- int message id
- byte[] data
- Author:
- Michael Röder (roeder@informatik.uni-leipzig.de)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static SimpleFileSendercreate(RabbitQueueFactory factory, String queueName) voidsetMessageSize(int messageSize) voidstreamData(InputStream is, String name)
-
Field Details
-
DEFAULT_MESSAGE_SIZE
private static final int DEFAULT_MESSAGE_SIZE- See Also:
-
queue
-
messageSize
private int messageSize
-
-
Constructor Details
-
SimpleFileSender
-
-
Method Details
-
create
public static SimpleFileSender create(RabbitQueueFactory factory, String queueName) throws IOException - Throws:
IOException
-
streamData
- Throws:
IOException
-
setMessageSize
public void setMessageSize(int messageSize) -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-