Example usage for com.rabbitmq.client RpcClient close

List of usage examples for com.rabbitmq.client RpcClient close

Introduction

In this page you can find the example usage for com.rabbitmq.client RpcClient close.

Prototype

public void close() throws IOException 

Source Link

Document

Public API - cancels the consumer, thus deleting the temporary queue, and marks the RpcClient as closed.

Usage

From source file:reactor.rabbitmq.docs.ApiGuideSender.java

License:Open Source License

void rpc() {
    // tag::rpc[]
    String queue = "rpc.server.queue";
    Sender sender = RabbitFlux.createSender();
    RpcClient rpcClient = sender.rpcClient("", queue); // <1>
    Mono<Delivery> reply = rpcClient.rpc(Mono.just(new RpcClient.RpcRequest("hello".getBytes()) // <2>
    ));/*from   ww  w  .j av  a 2  s  . co m*/
    rpcClient.close(); // <3>
    // end::rpc[]
}

From source file:reactor.rabbitmq.docs.ApiGuideSender.java

License:Open Source License

void rpcCorrelationIdProvider() {
    // tag::rpc-supplier[]
    String queue = "rpc.server.queue";
    Supplier<String> correlationIdSupplier = () -> UUID.randomUUID().toString(); // <1>
    Sender sender = RabbitFlux.createSender();
    RpcClient rpcClient = sender.rpcClient("", queue, correlationIdSupplier // <2>
    );//from w ww  .  j a  v a  2 s.  c  o m
    Mono<Delivery> reply = rpcClient.rpc(Mono.just(new RpcClient.RpcRequest("hello".getBytes())));
    rpcClient.close();
    // end::rpc-supplier[]
}