public class ReactorNettyClient
extends java.lang.Object
ReactorNettyClientOptions constructors for
advanced settings, e.g. TLS, authentication other than HTTP basic, etc.
The default settings for this class are the following:
HttpClient: created with the HttpClient.baseUrl(String).
ObjectMapper: DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES and
MapperFeature.DEFAULT_VIEW_INCLUSION are disabled.
Mono<String> token: basic HTTP authentication used for the
authorization header.
BiConsumer<? super HttpRequest, ? super HttpResponse> responseCallback:
4xx and 5xx responses on GET requests throw HttpClientException and HttpServerException
respectively.
ReactorNettyClientOptions| Constructor and Description |
|---|
ReactorNettyClient(java.lang.String url) |
ReactorNettyClient(java.lang.String url,
ReactorNettyClientOptions options) |
ReactorNettyClient(java.lang.String url,
java.lang.String username,
java.lang.String password) |
ReactorNettyClient(java.lang.String url,
java.lang.String username,
java.lang.String password,
ReactorNettyClientOptions options) |
| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Mono<AlivenessTestResult> |
alivenessTest(java.lang.String vhost) |
protected java.util.function.Consumer<reactor.netty.http.client.HttpClientResponse> |
applyResponseCallback() |
protected java.util.function.Function<? super io.netty.handler.codec.http.HttpHeaders,reactor.core.publisher.Mono<? extends io.netty.handler.codec.http.HttpHeaders>> |
authorizedHeader() |
static java.lang.String |
basicAuthentication(java.lang.String username,
java.lang.String password) |
reactor.core.publisher.Mono<HttpResponse> |
bindExchange(java.lang.String vhost,
java.lang.String destination,
java.lang.String source,
java.lang.String routingKey) |
reactor.core.publisher.Mono<HttpResponse> |
bindExchange(java.lang.String vhost,
java.lang.String destination,
java.lang.String source,
java.lang.String routingKey,
java.util.Map<java.lang.String,java.lang.Object> args) |
reactor.core.publisher.Mono<HttpResponse> |
bindQueue(java.lang.String vhost,
java.lang.String queue,
java.lang.String exchange,
java.lang.String routingKey) |
reactor.core.publisher.Mono<HttpResponse> |
bindQueue(java.lang.String vhost,
java.lang.String queue,
java.lang.String exchange,
java.lang.String routingKey,
java.util.Map<java.lang.String,java.lang.Object> args) |
reactor.core.publisher.Mono<HttpResponse> |
clearPermissions(java.lang.String vhost,
java.lang.String username) |
reactor.core.publisher.Mono<HttpResponse> |
clearTopicPermissions(java.lang.String vhost,
java.lang.String username) |
reactor.core.publisher.Mono<HttpResponse> |
closeConnection(java.lang.String name) |
reactor.core.publisher.Mono<HttpResponse> |
closeConnection(java.lang.String name,
java.lang.String reason) |
static reactor.core.publisher.Mono<java.lang.String> |
createBasicAuthenticationToken(java.lang.String username,
java.lang.String password) |
static com.fasterxml.jackson.databind.ObjectMapper |
createDefaultObjectMapper() |
reactor.core.publisher.Mono<HttpResponse> |
createUser(java.lang.String username,
char[] password,
java.util.List<java.lang.String> tags) |
reactor.core.publisher.Mono<HttpResponse> |
createUserWithPasswordHash(java.lang.String username,
char[] passwordHash,
java.util.List<java.lang.String> tags) |
reactor.core.publisher.Mono<HttpResponse> |
createVhost(java.lang.String name) |
reactor.core.publisher.Mono<HttpResponse> |
createVhost(java.lang.String name,
boolean tracing)
Create a virtual host with name and tracing flag.
|
reactor.core.publisher.Mono<HttpResponse> |
createVhost(java.lang.String name,
boolean tracing,
java.lang.String description,
java.lang.String... tags)
Create a virtual host with name, tracing flag, and metadata.
|
reactor.core.publisher.Mono<HttpResponse> |
createVhost(java.lang.String name,
java.lang.String description,
java.lang.String... tags)
Create a virtual host with name and metadata.
|
reactor.core.publisher.Mono<HttpResponse> |
declareExchange(java.lang.String vhost,
java.lang.String name,
ExchangeInfo info) |
reactor.core.publisher.Mono<HttpResponse> |
declarePolicy(java.lang.String vhost,
java.lang.String name,
PolicyInfo info) |
reactor.core.publisher.Mono<HttpResponse> |
declareQueue(java.lang.String vhost,
java.lang.String name,
QueueInfo info) |
reactor.core.publisher.Mono<HttpResponse> |
declareShovel(java.lang.String vhost,
ShovelInfo info) |
reactor.core.publisher.Mono<HttpResponse> |
declareUpstream(java.lang.String vhost,
java.lang.String name,
UpstreamDetails details)
Declares an upstream
|
reactor.core.publisher.Mono<HttpResponse> |
declareUpstreamSet(java.lang.String vhost,
java.lang.String name,
java.util.List<UpstreamSetDetails> details)
Declares an upstream set.
|
protected <T> java.util.function.BiFunction<? super reactor.netty.http.client.HttpClientResponse,? super reactor.netty.ByteBufFlux,org.reactivestreams.Publisher<T>> |
decode(java.lang.Class<T> type) |
reactor.core.publisher.Mono<HttpResponse> |
deleteExchange(java.lang.String vhost,
java.lang.String name) |
reactor.core.publisher.Mono<HttpResponse> |
deletePolicy(java.lang.String vhost,
java.lang.String name) |
reactor.core.publisher.Mono<HttpResponse> |
deleteQueue(java.lang.String vhost,
java.lang.String name) |
reactor.core.publisher.Mono<HttpResponse> |
deleteShovel(java.lang.String vhost,
java.lang.String shovelName) |
reactor.core.publisher.Mono<HttpResponse> |
deleteUpstream(java.lang.String vhost,
java.lang.String name)
Deletes an upstream
|
reactor.core.publisher.Mono<HttpResponse> |
deleteUpstreamSet(java.lang.String vhost,
java.lang.String name)
Deletes an upstream set
|
reactor.core.publisher.Mono<HttpResponse> |
deleteUser(java.lang.String username) |
reactor.core.publisher.Mono<HttpResponse> |
deleteVhost(java.lang.String name) |
reactor.core.publisher.Mono<InboundMessage> |
get(java.lang.String vhost,
java.lang.String queue)
Get one message from a queue and requeue it.
|
reactor.core.publisher.Flux<InboundMessage> |
get(java.lang.String vhost,
java.lang.String queue,
int count,
GetAckMode ackMode,
GetEncoding encoding)
Get messages from a queue, with no limit for message payload truncation.
|
reactor.core.publisher.Flux<InboundMessage> |
get(java.lang.String vhost,
java.lang.String queue,
int count,
GetAckMode ackMode,
GetEncoding encoding,
int truncate)
Get messages from a queue.
|
reactor.core.publisher.Flux<BindingInfo> |
getBindings() |
reactor.core.publisher.Flux<BindingInfo> |
getBindings(java.lang.String vhost) |
reactor.core.publisher.Mono<ChannelInfo> |
getChannel(java.lang.String name) |
reactor.core.publisher.Flux<ChannelInfo> |
getChannels() |
reactor.core.publisher.Flux<ChannelInfo> |
getChannels(java.lang.String connectionName) |
reactor.core.publisher.Mono<ClusterId> |
getClusterName() |
reactor.core.publisher.Mono<ConnectionInfo> |
getConnection(java.lang.String name) |
reactor.core.publisher.Flux<ConnectionInfo> |
getConnections() |
reactor.core.publisher.Mono<Definitions> |
getDefinitions() |
reactor.core.publisher.Mono<ExchangeInfo> |
getExchange(java.lang.String vhost,
java.lang.String name) |
reactor.core.publisher.Flux<BindingInfo> |
getExchangeBindingsBetween(java.lang.String vhost,
java.lang.String source,
java.lang.String destination) |
reactor.core.publisher.Flux<BindingInfo> |
getExchangeBindingsByDestination(java.lang.String vhost,
java.lang.String exchange) |
reactor.core.publisher.Flux<BindingInfo> |
getExchangeBindingsBySource(java.lang.String vhost,
java.lang.String exchange) |
reactor.core.publisher.Flux<ExchangeInfo> |
getExchanges() |
reactor.core.publisher.Flux<ExchangeInfo> |
getExchanges(java.lang.String vhost) |
reactor.core.publisher.Flux<java.util.Map> |
getExtensions() |
reactor.core.publisher.Mono<NodeInfo> |
getNode(java.lang.String name) |
reactor.core.publisher.Flux<NodeInfo> |
getNodes() |
reactor.core.publisher.Mono<OverviewResponse> |
getOverview() |
reactor.core.publisher.Flux<UserPermissions> |
getPermissions() |
reactor.core.publisher.Mono<UserPermissions> |
getPermissions(java.lang.String vhost,
java.lang.String username) |
reactor.core.publisher.Flux<UserPermissions> |
getPermissionsIn(java.lang.String vhost) |
reactor.core.publisher.Flux<UserPermissions> |
getPermissionsOf(java.lang.String username) |
reactor.core.publisher.Flux<PolicyInfo> |
getPolicies() |
reactor.core.publisher.Flux<PolicyInfo> |
getPolicies(java.lang.String vhost) |
reactor.core.publisher.Mono<QueueInfo> |
getQueue(java.lang.String vhost,
java.lang.String name) |
reactor.core.publisher.Flux<BindingInfo> |
getQueueBindings(java.lang.String vhost,
java.lang.String queue) |
reactor.core.publisher.Flux<BindingInfo> |
getQueueBindingsBetween(java.lang.String vhost,
java.lang.String exchange,
java.lang.String queue) |
reactor.core.publisher.Flux<QueueInfo> |
getQueues() |
reactor.core.publisher.Flux<QueueInfo> |
getQueues(java.lang.String vhost) |
reactor.core.publisher.Flux<ShovelInfo> |
getShovels() |
reactor.core.publisher.Flux<ShovelStatus> |
getShovelsStatus() |
reactor.core.publisher.Flux<TopicPermissions> |
getTopicPermissions() |
reactor.core.publisher.Flux<TopicPermissions> |
getTopicPermissions(java.lang.String vhost,
java.lang.String username) |
reactor.core.publisher.Flux<TopicPermissions> |
getTopicPermissionsIn(java.lang.String vhost) |
reactor.core.publisher.Flux<TopicPermissions> |
getTopicPermissionsOf(java.lang.String username) |
reactor.core.publisher.Flux<UpstreamInfo> |
getUpstreams()
Returns a list of upstreams for "/" virtual host
|
reactor.core.publisher.Flux<UpstreamInfo> |
getUpstreams(java.lang.String vhost)
Returns a list of upstreams
|
reactor.core.publisher.Flux<UpstreamSetInfo> |
getUpstreamSets()
Returns a list of upstream sets for "/" virtual host
|
reactor.core.publisher.Flux<UpstreamSetInfo> |
getUpstreamSets(java.lang.String vhost)
Returns a ist of upstream sets
|
reactor.core.publisher.Mono<UserInfo> |
getUser(java.lang.String username) |
reactor.core.publisher.Flux<UserInfo> |
getUsers() |
reactor.core.publisher.Mono<VhostInfo> |
getVhost(java.lang.String name) |
reactor.core.publisher.Flux<VhostInfo> |
getVhosts() |
reactor.core.publisher.Mono<java.lang.Boolean> |
publish(java.lang.String vhost,
java.lang.String exchange,
java.lang.String routingKey,
OutboundMessage outboundMessage)
Publishes a message to an exchange.
|
reactor.core.publisher.Mono<HttpResponse> |
purgeQueue(java.lang.String vhost,
java.lang.String name) |
reactor.core.publisher.Mono<HttpResponse> |
setClusterName(java.lang.String name) |
reactor.core.publisher.Mono<HttpResponse> |
updatePermissions(java.lang.String vhost,
java.lang.String username,
UserPermissions permissions) |
reactor.core.publisher.Mono<HttpResponse> |
updateTopicPermissions(java.lang.String vhost,
java.lang.String username,
TopicPermissions permissions) |
reactor.core.publisher.Mono<HttpResponse> |
updateUser(java.lang.String username,
char[] password,
java.util.List<java.lang.String> tags) |
reactor.core.publisher.Mono<CurrentUserDetails> |
whoAmI() |
public ReactorNettyClient(java.lang.String url,
ReactorNettyClientOptions options)
public ReactorNettyClient(java.lang.String url)
public ReactorNettyClient(java.lang.String url,
java.lang.String username,
java.lang.String password)
public ReactorNettyClient(java.lang.String url,
java.lang.String username,
java.lang.String password,
ReactorNettyClientOptions options)
public static com.fasterxml.jackson.databind.ObjectMapper createDefaultObjectMapper()
public static reactor.core.publisher.Mono<java.lang.String> createBasicAuthenticationToken(java.lang.String username,
java.lang.String password)
public static java.lang.String basicAuthentication(java.lang.String username,
java.lang.String password)
public reactor.core.publisher.Mono<OverviewResponse> getOverview()
public reactor.core.publisher.Flux<NodeInfo> getNodes()
public reactor.core.publisher.Mono<NodeInfo> getNode(java.lang.String name)
public reactor.core.publisher.Flux<ConnectionInfo> getConnections()
public reactor.core.publisher.Mono<ConnectionInfo> getConnection(java.lang.String name)
public reactor.core.publisher.Mono<HttpResponse> closeConnection(java.lang.String name)
public reactor.core.publisher.Mono<HttpResponse> closeConnection(java.lang.String name, java.lang.String reason)
public reactor.core.publisher.Mono<HttpResponse> declarePolicy(java.lang.String vhost, java.lang.String name, PolicyInfo info)
public reactor.core.publisher.Flux<PolicyInfo> getPolicies()
public reactor.core.publisher.Flux<PolicyInfo> getPolicies(java.lang.String vhost)
public reactor.core.publisher.Mono<HttpResponse> deletePolicy(java.lang.String vhost, java.lang.String name)
public reactor.core.publisher.Flux<ChannelInfo> getChannels()
public reactor.core.publisher.Flux<ChannelInfo> getChannels(java.lang.String connectionName)
public reactor.core.publisher.Mono<ChannelInfo> getChannel(java.lang.String name)
public reactor.core.publisher.Flux<VhostInfo> getVhosts()
public reactor.core.publisher.Mono<VhostInfo> getVhost(java.lang.String name)
public reactor.core.publisher.Mono<HttpResponse> createVhost(java.lang.String name, boolean tracing, java.lang.String description, java.lang.String... tags)
name - name of the virtual hosttracing - whether tracing is enabled or notdescription - virtual host description (requires RabbitMQ 3.8 or more)tags - virtual host tags (requires RabbitMQ 3.8 or more)Monopublic reactor.core.publisher.Mono<HttpResponse> createVhost(java.lang.String name, java.lang.String description, java.lang.String... tags)
name - name of the virtual hostdescription - virtual host description (requires RabbitMQ 3.8 or more)tags - virtual host tags (requires RabbitMQ 3.8 or more)Monopublic reactor.core.publisher.Mono<HttpResponse> createVhost(java.lang.String name, boolean tracing)
name - name of the virtual hosttracing - whether tracing is enabled or notMonopublic reactor.core.publisher.Mono<HttpResponse> createVhost(java.lang.String name)
public reactor.core.publisher.Mono<HttpResponse> deleteVhost(java.lang.String name)
public reactor.core.publisher.Flux<UserPermissions> getPermissionsIn(java.lang.String vhost)
public reactor.core.publisher.Mono<HttpResponse> updatePermissions(java.lang.String vhost, java.lang.String username, UserPermissions permissions)
public reactor.core.publisher.Flux<TopicPermissions> getTopicPermissionsIn(java.lang.String vhost)
public reactor.core.publisher.Mono<HttpResponse> updateTopicPermissions(java.lang.String vhost, java.lang.String username, TopicPermissions permissions)
public reactor.core.publisher.Flux<UserInfo> getUsers()
public reactor.core.publisher.Mono<UserInfo> getUser(java.lang.String username)
public reactor.core.publisher.Mono<HttpResponse> deleteUser(java.lang.String username)
public reactor.core.publisher.Mono<HttpResponse> createUser(java.lang.String username, char[] password, java.util.List<java.lang.String> tags)
public reactor.core.publisher.Mono<HttpResponse> updateUser(java.lang.String username, char[] password, java.util.List<java.lang.String> tags)
public reactor.core.publisher.Flux<UserPermissions> getPermissionsOf(java.lang.String username)
public reactor.core.publisher.Flux<TopicPermissions> getTopicPermissionsOf(java.lang.String username)
public reactor.core.publisher.Mono<HttpResponse> createUserWithPasswordHash(java.lang.String username, char[] passwordHash, java.util.List<java.lang.String> tags)
public reactor.core.publisher.Mono<CurrentUserDetails> whoAmI()
public reactor.core.publisher.Flux<UserPermissions> getPermissions()
public reactor.core.publisher.Mono<UserPermissions> getPermissions(java.lang.String vhost, java.lang.String username)
public reactor.core.publisher.Mono<HttpResponse> clearPermissions(java.lang.String vhost, java.lang.String username)
public reactor.core.publisher.Flux<TopicPermissions> getTopicPermissions()
public reactor.core.publisher.Flux<TopicPermissions> getTopicPermissions(java.lang.String vhost, java.lang.String username)
public reactor.core.publisher.Mono<HttpResponse> clearTopicPermissions(java.lang.String vhost, java.lang.String username)
public reactor.core.publisher.Flux<ExchangeInfo> getExchanges()
public reactor.core.publisher.Flux<ExchangeInfo> getExchanges(java.lang.String vhost)
public reactor.core.publisher.Mono<ExchangeInfo> getExchange(java.lang.String vhost, java.lang.String name)
public reactor.core.publisher.Mono<HttpResponse> declareExchange(java.lang.String vhost, java.lang.String name, ExchangeInfo info)
public reactor.core.publisher.Mono<HttpResponse> deleteExchange(java.lang.String vhost, java.lang.String name)
public reactor.core.publisher.Mono<java.lang.Boolean> publish(java.lang.String vhost,
java.lang.String exchange,
java.lang.String routingKey,
OutboundMessage outboundMessage)
DO NOT USE THIS METHOD IN PRODUCTION. The HTTP API has to create a new TCP connection for each message published, which is highly suboptimal.
Use this method for test or development code only. In production, use AMQP 0-9-1 or any other messaging protocol that uses a long-lived connection.
vhost - the virtual host to useexchange - the target exchangeroutingKey - the routing key to useoutboundMessage - the message to publishpublic reactor.core.publisher.Mono<AlivenessTestResult> alivenessTest(java.lang.String vhost)
public reactor.core.publisher.Mono<ClusterId> getClusterName()
public reactor.core.publisher.Mono<HttpResponse> setClusterName(java.lang.String name)
public reactor.core.publisher.Flux<java.util.Map> getExtensions()
public reactor.core.publisher.Mono<Definitions> getDefinitions()
public reactor.core.publisher.Flux<QueueInfo> getQueues()
public reactor.core.publisher.Flux<QueueInfo> getQueues(java.lang.String vhost)
public reactor.core.publisher.Mono<QueueInfo> getQueue(java.lang.String vhost, java.lang.String name)
public reactor.core.publisher.Mono<HttpResponse> declareQueue(java.lang.String vhost, java.lang.String name, QueueInfo info)
public reactor.core.publisher.Mono<HttpResponse> purgeQueue(java.lang.String vhost, java.lang.String name)
public reactor.core.publisher.Mono<HttpResponse> deleteQueue(java.lang.String vhost, java.lang.String name)
public reactor.core.publisher.Flux<InboundMessage> get(java.lang.String vhost, java.lang.String queue, int count, GetAckMode ackMode, GetEncoding encoding, int truncate)
vhost - the virtual host the target queue is inqueue - the queue to consume fromcount - the maximum number of messages to getackMode - determines whether the messages will be removed from the queueencoding - the expected encoding of the message payloadtruncate - to truncate the message payload if it is larger than the size given (in bytes), -1 means no truncationFluxGetAckMode,
GetEncodingpublic reactor.core.publisher.Flux<InboundMessage> get(java.lang.String vhost, java.lang.String queue, int count, GetAckMode ackMode, GetEncoding encoding)
vhost - the virtual host the target queue is inqueue - the queue to consume fromcount - the maximum number of messages to getackMode - determines whether the messages will be removed from the queueencoding - the expected encoding of the message payloadFluxGetAckMode,
GetEncodingpublic reactor.core.publisher.Mono<InboundMessage> get(java.lang.String vhost, java.lang.String queue)
vhost - the virtual host the target queue is inqueue - the queue to consume fromMonoGetAckMode,
GetEncodingpublic reactor.core.publisher.Flux<BindingInfo> getBindings()
public reactor.core.publisher.Flux<BindingInfo> getBindings(java.lang.String vhost)
public reactor.core.publisher.Flux<BindingInfo> getExchangeBindingsBySource(java.lang.String vhost, java.lang.String exchange)
public reactor.core.publisher.Flux<BindingInfo> getExchangeBindingsByDestination(java.lang.String vhost, java.lang.String exchange)
public reactor.core.publisher.Flux<BindingInfo> getQueueBindings(java.lang.String vhost, java.lang.String queue)
public reactor.core.publisher.Flux<BindingInfo> getQueueBindingsBetween(java.lang.String vhost, java.lang.String exchange, java.lang.String queue)
public reactor.core.publisher.Flux<BindingInfo> getExchangeBindingsBetween(java.lang.String vhost, java.lang.String source, java.lang.String destination)
public reactor.core.publisher.Mono<HttpResponse> bindExchange(java.lang.String vhost, java.lang.String destination, java.lang.String source, java.lang.String routingKey)
public reactor.core.publisher.Mono<HttpResponse> bindExchange(java.lang.String vhost, java.lang.String destination, java.lang.String source, java.lang.String routingKey, java.util.Map<java.lang.String,java.lang.Object> args)
public reactor.core.publisher.Mono<HttpResponse> bindQueue(java.lang.String vhost, java.lang.String queue, java.lang.String exchange, java.lang.String routingKey)
public reactor.core.publisher.Mono<HttpResponse> bindQueue(java.lang.String vhost, java.lang.String queue, java.lang.String exchange, java.lang.String routingKey, java.util.Map<java.lang.String,java.lang.Object> args)
public reactor.core.publisher.Mono<HttpResponse> declareShovel(java.lang.String vhost, ShovelInfo info)
public reactor.core.publisher.Flux<ShovelInfo> getShovels()
public reactor.core.publisher.Flux<ShovelStatus> getShovelsStatus()
public reactor.core.publisher.Mono<HttpResponse> deleteShovel(java.lang.String vhost, java.lang.String shovelName)
public reactor.core.publisher.Mono<HttpResponse> declareUpstream(java.lang.String vhost, java.lang.String name, UpstreamDetails details)
vhost - virtual host for which to declare the upstreamname - name of the upstream to declaredetails - upstream argumentspublic reactor.core.publisher.Mono<HttpResponse> deleteUpstream(java.lang.String vhost, java.lang.String name)
vhost - virtual host for which to delete the upstreamname - name of the upstream to deletepublic reactor.core.publisher.Flux<UpstreamInfo> getUpstreams()
public reactor.core.publisher.Flux<UpstreamInfo> getUpstreams(java.lang.String vhost)
vhost - virtual host the upstreams are in.public reactor.core.publisher.Mono<HttpResponse> declareUpstreamSet(java.lang.String vhost, java.lang.String name, java.util.List<UpstreamSetDetails> details)
vhost - virtual host for which to declare the upstream setname - name of the upstream set to declaredetails - upstream set argumentspublic reactor.core.publisher.Mono<HttpResponse> deleteUpstreamSet(java.lang.String vhost, java.lang.String name)
vhost - virtual host for which to delete the upstream setname - name of the upstream set to deletepublic reactor.core.publisher.Flux<UpstreamSetInfo> getUpstreamSets()
public reactor.core.publisher.Flux<UpstreamSetInfo> getUpstreamSets(java.lang.String vhost)
vhost - Virtual host from where to get upstreams.protected <T> java.util.function.BiFunction<? super reactor.netty.http.client.HttpClientResponse,? super reactor.netty.ByteBufFlux,org.reactivestreams.Publisher<T>> decode(java.lang.Class<T> type)
protected java.util.function.Function<? super io.netty.handler.codec.http.HttpHeaders,reactor.core.publisher.Mono<? extends io.netty.handler.codec.http.HttpHeaders>> authorizedHeader()
protected java.util.function.Consumer<reactor.netty.http.client.HttpClientResponse> applyResponseCallback()