@Internal @EachBean(value=ChannelPool.class) public class ReactorReactivePublisher extends java.lang.Object implements ReactivePublisher
Mono
.
This is an internal API and may change at any time
Constructor and Description |
---|
ReactorReactivePublisher(ChannelPool channelPool,
RabbitConnectionFactoryConfig config)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected reactor.core.Disposable |
createConsumer(com.rabbitmq.client.Channel channel,
RabbitPublishState publishState,
java.lang.String correlationId,
reactor.core.publisher.MonoSink<RabbitConsumerState> emitter)
Listens for ack/nack from the broker.
|
protected reactor.core.Disposable |
createListener(com.rabbitmq.client.Channel channel,
reactor.core.publisher.MonoSink<java.lang.Object> emitter,
RabbitPublishState publishState)
Listens for ack/nack from the broker.
|
protected reactor.core.publisher.Mono<com.rabbitmq.client.Channel> |
getChannel()
Creates a
Mono from a channel, emitting an error
if the channel could not be retrieved. |
protected reactor.core.publisher.Mono<com.rabbitmq.client.Channel> |
initializePublish(com.rabbitmq.client.Channel channel)
Initializes the channel to allow publisher acknowledgements.
|
reactor.core.publisher.Mono<java.lang.Void> |
publish(RabbitPublishState publishState)
Publish the message with the provided arguments and return
a reactive type that completes successfully when the message
is published.
|
reactor.core.publisher.Mono<java.lang.Void> |
publishAndConfirm(RabbitPublishState publishState)
Publish the message with the provided arguments and return
a reactive type that completes successfully when the broker
acknowledged the message.
|
reactor.core.publisher.Flux<RabbitConsumerState> |
publishAndReply(RabbitPublishState publishState)
Publish the message with the provided arguments and return
a reactive type that completes successfully when the reply
is received from the reply to queue.
|
protected reactor.core.publisher.Mono<java.lang.Object> |
publishInternal(com.rabbitmq.client.Channel channel,
RabbitPublishState publishState)
Publishes the message to the channel.
|
protected reactor.core.publisher.Mono<java.lang.Object> |
publishInternalNoConfirm(com.rabbitmq.client.Channel channel,
RabbitPublishState publishState)
Publishes the message to the channel.
|
protected reactor.core.publisher.Mono<RabbitConsumerState> |
publishRpcInternal(com.rabbitmq.client.Channel channel,
RabbitPublishState publishState)
Publishes the message to the channel.
|
protected void |
returnChannel(com.rabbitmq.client.Channel channel)
Removes confirm listeners from the channel and returns the
channel to the pool.
|
public ReactorReactivePublisher(@Parameter ChannelPool channelPool, @Parameter RabbitConnectionFactoryConfig config)
channelPool
- The channel pool to retrieve channelsconfig
- Any configuration used in building the publisherspublic reactor.core.publisher.Mono<java.lang.Void> publishAndConfirm(RabbitPublishState publishState)
ReactivePublisher
publishAndConfirm
in interface ReactivePublisher
publishState
- The RabbitMQ publishing datapublic reactor.core.publisher.Mono<java.lang.Void> publish(RabbitPublishState publishState)
ReactivePublisher
publish
in interface ReactivePublisher
publishState
- The RabbitMQ publishing datapublic reactor.core.publisher.Flux<RabbitConsumerState> publishAndReply(RabbitPublishState publishState)
ReactivePublisher
publishAndReply
in interface ReactivePublisher
publishState
- The RabbitMQ publishing dataprotected reactor.core.publisher.Mono<com.rabbitmq.client.Channel> getChannel()
Mono
from a channel, emitting an error
if the channel could not be retrieved.Mono
that emits the channel on successprotected reactor.core.publisher.Mono<java.lang.Object> publishInternal(com.rabbitmq.client.Channel channel, RabbitPublishState publishState)
Mono
returned from this
method should ensure the ConfirmListener
is added to the channel prior
to publishing and the ConfirmListener
is removed from the channel after
the publish has been acknowledged.channel
- The channel to publish the message topublishState
- The publishing stateChannel.basicPublish(String, String, AMQP.BasicProperties, byte[])
protected reactor.core.publisher.Mono<RabbitConsumerState> publishRpcInternal(com.rabbitmq.client.Channel channel, RabbitPublishState publishState)
Mono
returned from this
method should ensure the ConfirmListener
is added to the channel prior
to publishing and the ConfirmListener
is removed from the channel after
the publish has been acknowledged.channel
- The channel to publish the message topublishState
- The publishing stateChannel.basicPublish(String, String, AMQP.BasicProperties, byte[])
protected reactor.core.publisher.Mono<java.lang.Object> publishInternalNoConfirm(com.rabbitmq.client.Channel channel, RabbitPublishState publishState)
Mono
returned from this
method should ensure the ConfirmListener
is added to the channel prior
to publishing and the ConfirmListener
is removed from the channel after
the publish has been acknowledged.channel
- The channel to publish the message topublishState
- The publishing stateChannel.basicPublish(String, String, AMQP.BasicProperties, byte[])
protected reactor.core.publisher.Mono<com.rabbitmq.client.Channel> initializePublish(com.rabbitmq.client.Channel channel)
channel
- The channel to enable acknowledgements.Mono
that will complete according to the
success of the operation.protected void returnChannel(com.rabbitmq.client.Channel channel)
channel
- The channel to clean and returnprotected reactor.core.Disposable createListener(com.rabbitmq.client.Channel channel, reactor.core.publisher.MonoSink<java.lang.Object> emitter, RabbitPublishState publishState)
channel
- The channel to listen for confirmsemitter
- The emitter to send the eventpublishState
- The publishing stateprotected reactor.core.Disposable createConsumer(com.rabbitmq.client.Channel channel, RabbitPublishState publishState, java.lang.String correlationId, reactor.core.publisher.MonoSink<RabbitConsumerState> emitter) throws java.io.IOException
channel
- The channel to listen for confirmspublishState
- The publish statecorrelationId
- The correlation idemitter
- The emitter to send the responsejava.io.IOException
- If an error occurred subscribing