Package io.atleon.rabbitmq
Class AloRabbitMQReceiver<T>
- java.lang.Object
-
- io.atleon.rabbitmq.AloRabbitMQReceiver<T>
-
- Type Parameters:
T- Inbound message deserialized body type
public class AloRabbitMQReceiver<T> extends Object
A reactive RabbitMQ receiver with at-least-once semantics for consuming messages from a queue in a RabbitMQ cluster.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAloRabbitMQReceiver.NackStrategyStrategy for handling Nacknowledgement - EMIT causes error to be emitted to subscribers - REQUEUE causes nacknowledged message to be nack'd with requeue - DISCARD causes nacknowledged message to be nack'ed with discard Default is EMIT
-
Field Summary
Fields Modifier and Type Field Description static StringALO_DECORATOR_DESCRIPTORS_CONFIGOptional comma-separated list ofAloRabbitMQMessageDecoratordescriptors.static StringBODY_DESERIALIZER_CONFIGAn implementation ofBodyDeserializerused to deserialized message bodiesstatic StringCONFIG_PREFIXPrefix used on all AloRabbitMQReceiver-specific configurationsstatic StringNACK_STRATEGY_CONFIGStrategy used for handling Nacknowledgement.static StringQOS_CONFIGThe maximum allowed number unacknowledged messages (per subscription)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> AloRabbitMQReceiver<T>from(RabbitMQConfigSource configSource)Creates a new AloRabbitMQReceiver from the providedRabbitMQConfigSourceio.atleon.core.AloFlux<T>receiveAloBodies(String queue)Creates a Publisher ofAloitems referencing deserialized RabbitMQ message bodies wrapped as anAloFlux.io.atleon.core.AloFlux<RabbitMQMessage<T>>receiveAloMessages(String queue)
-
-
-
Field Detail
-
CONFIG_PREFIX
public static final String CONFIG_PREFIX
Prefix used on all AloRabbitMQReceiver-specific configurations- See Also:
- Constant Field Values
-
QOS_CONFIG
public static final String QOS_CONFIG
The maximum allowed number unacknowledged messages (per subscription)- See Also:
- Constant Field Values
-
BODY_DESERIALIZER_CONFIG
public static final String BODY_DESERIALIZER_CONFIG
An implementation ofBodyDeserializerused to deserialized message bodies- See Also:
- Constant Field Values
-
NACK_STRATEGY_CONFIG
public static final String NACK_STRATEGY_CONFIG
Strategy used for handling Nacknowledgement. SeeAloRabbitMQReceiver.NackStrategy- See Also:
- Constant Field Values
-
ALO_DECORATOR_DESCRIPTORS_CONFIG
public static final String ALO_DECORATOR_DESCRIPTORS_CONFIG
Optional comma-separated list ofAloRabbitMQMessageDecoratordescriptors. Each descriptor is either a predefined type defined inAloDecoratorConfigor a fully qualified name of a class that implementsAloRabbitMQMessageDecorator. Defaults toAloDecoratorConfig.DESCRIPTOR_AUTO, which results in automatic loading of decorators through theServiceLoaderSPI.- See Also:
- Constant Field Values
-
-
Method Detail
-
from
public static <T> AloRabbitMQReceiver<T> from(RabbitMQConfigSource configSource)
Creates a new AloRabbitMQReceiver from the providedRabbitMQConfigSource- Type Parameters:
T- The types of deserialized message bodies contained in received messages- Parameters:
configSource- The reactive source ofRabbitMQConfig- Returns:
- A new AloRabbitMQReceiver
-
receiveAloBodies
public io.atleon.core.AloFlux<T> receiveAloBodies(String queue)
Creates a Publisher ofAloitems referencing deserialized RabbitMQ message bodies wrapped as anAloFlux.- Parameters:
queue- The queue to subscribe to- Returns:
- A Publisher of Alo items referencing deserialized RabbitMQ message bodies
-
receiveAloMessages
public io.atleon.core.AloFlux<RabbitMQMessage<T>> receiveAloMessages(String queue)
- Parameters:
queue- The queue to subscribe to- Returns:
- A Publisher of Alo items referencing RabbitMQMessages
-
-