Package org.hobbit.core.rabbit
Class DataSenderImpl.Builder
java.lang.Object
org.hobbit.core.rabbit.DataSenderImpl.Builder
- Enclosing class:
- DataSenderImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected RabbitQueueFactoryprotected intprotected RabbitQueueprotected static final Stringprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theDataReceiverImplinstance with the previously given information.deliveryMode(int deliveryMode) Sets the delivery mode used for the RabbitMQ messages.messageBuffer(int messageConfirmBuffer) Sets the number of messages that are buffered while waiting for a confirmation that they have been received by the broker.queue(RabbitQueue queue) Sets the queue that is used to receive data.queue(RabbitQueueFactory factory, String queueName) Method for providing the necessary information to create a queue if it has not been provided with thequeue(RabbitQueue)method.
-
Field Details
-
QUEUE_INFO_MISSING_ERROR
- See Also:
-
queue
-
queueName
-
factory
-
messageConfirmBuffer
protected int messageConfirmBuffer -
deliveryMode
protected int deliveryMode
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
queue
Sets the queue that is used to receive data.- Parameters:
queue- the queue that is used to receive data- Returns:
- this builder instance
-
queue
Method for providing the necessary information to create a queue if it has not been provided with thequeue(RabbitQueue)method. Note that this information is not used if a queue has been provided.- Parameters:
factory- the queue factory used to create a queuequeueName- the name of the newly created queue- Returns:
- this builder instance
-
messageBuffer
Sets the number of messages that are buffered while waiting for a confirmation that they have been received by the broker. Note that if the message buffer has reached is maximum size, the sender will block until confirmations are received.
If the given message buffer size is
<1the usage of confirmation messages is turned off.- Parameters:
messageConfirmBuffer- the size of the messages buffer- Returns:
- this builder instance
-
deliveryMode
Sets the delivery mode used for the RabbitMQ messages. Please have a look into the RabbitMQ documentation to see the different meanings of the values. By default, the sender usesDataSenderImpl.DEFAULT_DELIVERY_MODE.- Parameters:
deliveryMode- the delivery mode used for the RabbitMQ messages- Returns:
- this builder instance
-
build
Builds theDataReceiverImplinstance with the previously given information.- Returns:
- The newly created DataReceiver instance
- Throws:
IllegalStateException- if neither a queue nor the information needed to create a queue have been provided.IOException- if an exception is thrown while creating a new queue.
-