public class NatsClient extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
NatsClient.ResultHolder
Class to retain results received by NATS client so that tests can poll the result and assert against.
|
| Constructor and Description |
|---|
NatsClient(String cluserId,
String natsUrl) |
NatsClient(String cluserId,
String natsUrl,
NatsClient.ResultHolder resultHolder) |
NatsClient(String clusterId,
String clientId,
String natsUrl) |
NatsClient(String clusterId,
String clientId,
String natsUrl,
NatsClient.ResultHolder resultHolder) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect() |
void |
publish(String subjectName,
String message) |
void |
subscrbeFromGivenTime(String subject,
Instant instant) |
void |
subscribe(String subject) |
void |
subscribeDurable(String subject,
String durableName) |
void |
subscribeFromGivenSequence(String subject,
int sequence) |
void |
subscribeFromLastPublished(String subject) |
void |
subscribeFromNow(String subject) |
void |
subscribeWithQueueGroupFromSequence(String subject,
String queueGroup,
int sequence) |
void |
unsubscribe() |
public NatsClient(String clusterId, String clientId, String natsUrl, NatsClient.ResultHolder resultHolder)
public NatsClient(String cluserId, String natsUrl, NatsClient.ResultHolder resultHolder)
public void connect()
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic void publish(String subjectName, String message) throws InterruptedException, TimeoutException, IOException
public void subscribeFromNow(String subject) throws InterruptedException, TimeoutException, IOException
public void subscribe(String subject) throws InterruptedException, IOException, TimeoutException
public void subscribeFromLastPublished(String subject) throws InterruptedException, IOException, TimeoutException
public void subscribeFromGivenSequence(String subject, int sequence) throws InterruptedException, IOException, TimeoutException
public void subscrbeFromGivenTime(String subject, Instant instant) throws InterruptedException, IOException, TimeoutException
public void subscribeDurable(String subject, String durableName) throws InterruptedException, IOException, TimeoutException
public void unsubscribe()
throws IOException
IOExceptionpublic void subscribeWithQueueGroupFromSequence(String subject, String queueGroup, int sequence) throws InterruptedException, TimeoutException, IOException
Copyright © 2019 WSO2. All rights reserved.