public interface StompClient
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the client.
|
StompClient |
connect(Handler<AsyncResult<StompClientConnection>> resultHandler)
Connects to the server using the host and port configured in the client's options.
|
StompClient |
connect(int port,
String host,
Handler<AsyncResult<StompClientConnection>> resultHandler)
Connects to the server.
|
StompClient |
connect(int port,
String host,
NetClient net,
Handler<AsyncResult<StompClientConnection>> resultHandler)
Connects to the server.
|
StompClient |
connect(NetClient net,
Handler<AsyncResult<StompClientConnection>> resultHandler)
Connects to the server.
|
static StompClient |
create(Vertx vertx)
Creates a
StompClient using the default implementation. |
static StompClient |
create(Vertx vertx,
StompClientOptions options)
Creates a
StompClient using the default implementation. |
StompClient |
errorFrameHandler(Handler<Frame> handler)
A general error frame handler.
|
StompClient |
exceptionHandler(Handler<Throwable> handler)
Sets an exception handler notified for TCP-level errors.
|
boolean |
isClosed() |
StompClientOptions |
options() |
StompClient |
receivedFrameHandler(Handler<Frame> handler)
Configures a received handler that gets notified when a STOMP frame is received by the client.
|
Vertx |
vertx() |
StompClient |
writingFrameHandler(Handler<Frame> handler)
Configures a writing handler that gets notified when a STOMP frame is written on the wire.
|
static StompClient create(Vertx vertx)
StompClient
using the default implementation.vertx
- the vert.x instance to useStompClient
static StompClient create(Vertx vertx, StompClientOptions options)
StompClient
using the default implementation.vertx
- the vert.x instance to useoptions
- the optionsStompClient
StompClient connect(int port, String host, Handler<AsyncResult<StompClientConnection>> resultHandler)
port
- the server porthost
- the server hostresultHandler
- handler called with the connection resultStompClient
StompClient connect(NetClient net, Handler<AsyncResult<StompClientConnection>> resultHandler)
net
- the NET client to useresultHandler
- handler called with the connection resultStompClient
StompClient connect(int port, String host, NetClient net, Handler<AsyncResult<StompClientConnection>> resultHandler)
port
- the server porthost
- the server hostnet
- the NET client to useresultHandler
- handler called with the connection resultStompClient
StompClient connect(Handler<AsyncResult<StompClientConnection>> resultHandler)
resultHandler
- handler called with the connection result. A failure will be sent to the handler if a TCP
level issue happen before the `CONNECTED` frame is received. Afterwards, the
exceptionHandler(Handler)
is called.StompClient
StompClient receivedFrameHandler(Handler<Frame> handler)
When a connection is created, the handler is used as
StompClientConnection.receivedFrameHandler(Handler)
.
handler
- the handlerStompClient
StompClient writingFrameHandler(Handler<Frame> handler)
When a connection is created, the handler is used as
StompClientConnection.writingFrameHandler(Handler)
.
handler
- the handlerStompClient
StompClient errorFrameHandler(Handler<Frame> handler)
ERROR
frame emitted during the connection process
(wrong authentication). This error handler will be pass to all StompClientConnection
created from this
client. Obviously, the client can override it when the connection is established.handler
- the handlerStompClient
StompClient exceptionHandler(Handler<Throwable> handler)
handler
- the handlerStompClient
void close()
StompClientOptions options()
Vertx vertx()
boolean isClosed()
Copyright © 2023 Eclipse. All rights reserved.