public final class ClientRequestor extends Object implements AutoCloseable
| Constructor and Description |
|---|
ClientRequestor(ClientSession session,
SimpleString requestAddress)
Constructor for the ClientRequestor.
|
ClientRequestor(ClientSession session,
String requestAddress) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the ClientRequestor and its session.
|
ClientMessage |
request(ClientMessage request)
Sends a message to the request address and wait indefinitely for a reply.
|
ClientMessage |
request(ClientMessage request,
long timeout)
Sends a message to the request address and wait for the given timeout for a reply.
|
public ClientRequestor(ClientSession session, SimpleString requestAddress) throws Exception
session - a ClientSession uses to handle requests and repliesrequestAddress - the address to send request messages toExceptionpublic ClientRequestor(ClientSession session, String requestAddress) throws Exception
ExceptionClientRequestor(ClientSession, SimpleString)public ClientMessage request(ClientMessage request) throws Exception
request - the message to sendExceptionpublic ClientMessage request(ClientMessage request, long timeout) throws Exception
request - the message to sendtimeout - the timeout to wait for a reply (in milliseconds)null if no message is replied before the timeout elapsesExceptionpublic void close()
throws Exception
close in interface AutoCloseableException - if an exception occurs while closing the ClientRequestorCopyright © 2018 The Apache Software Foundation. All rights reserved.