public class Client extends Object implements AutoCloseable
It is not meant for public usage and can change at any time.
Users are encouraged to use the Environment, Producer, Consumer API, and their respective builders to interact with the broker.
People wanting very fine control over their interaction with the broker can use Client
but at their own risk.
| Modifier and Type | Class and Description |
|---|---|
static class |
Client.Broker |
static interface |
Client.ChunkListener |
static class |
Client.ClientParameters |
static interface |
Client.CreditNotification |
static interface |
Client.MessageListener |
static interface |
Client.MetadataListener |
static interface |
Client.OutboundEntityMappingCallback |
static interface |
Client.PublishConfirmListener |
static interface |
Client.PublishErrorListener |
static class |
Client.QueryOffsetResponse |
static class |
Client.Response |
static class |
Client.ShutdownContext |
static interface |
Client.ShutdownListener |
static class |
Client.StreamMetadata |
static class |
Client.StreamParametersBuilder |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT |
static int |
DEFAULT_TLS_PORT |
| Constructor and Description |
|---|
Client() |
Client(Client.ClientParameters parameters) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Client.Response |
create(String stream) |
Client.Response |
create(String stream,
Map<String,String> arguments) |
void |
credit(byte subscriptionId,
int credit) |
Client.Response |
declarePublisher(byte publisherId,
String publisherReference,
String stream) |
Client.Response |
delete(String stream) |
Client.Response |
deletePublisher(byte publisherId) |
boolean |
isOpen() |
SocketAddress |
localAddress() |
MessageBuilder |
messageBuilder() |
Map<String,Client.StreamMetadata> |
metadata(String... streams) |
List<String> |
partitions(String superStream) |
List<Long> |
publish(byte publisherId,
List<Message> messages) |
List<Long> |
publish(byte publisherId,
List<Message> messages,
Client.OutboundEntityMappingCallback mappingCallback) |
List<Long> |
publish(byte publisherId,
List<Message> messages,
Client.OutboundEntityMappingCallback mappingCallback,
ToLongFunction<Object> publishSequenceFunction) |
List<Long> |
publish(byte publisherId,
List<Message> messages,
ToLongFunction<Object> publishSequenceFunction) |
List<Long> |
publishBatches(byte publisherId,
List<MessageBatch> messageBatches) |
List<Long> |
publishBatches(byte publisherId,
List<MessageBatch> messageBatches,
Client.OutboundEntityMappingCallback mappingCallback) |
List<Long> |
publishBatches(byte publisherId,
List<MessageBatch> messageBatches,
Client.OutboundEntityMappingCallback mappingCallback,
ToLongFunction<Object> publishSequenceFunction) |
List<Long> |
publishBatches(byte publisherId,
List<MessageBatch> messageBatches,
ToLongFunction<Object> publishSequenceFunction) |
Client.QueryOffsetResponse |
queryOffset(String reference,
String stream) |
long |
queryPublisherSequence(String publisherReference,
String stream) |
SocketAddress |
remoteAddress() |
List<String> |
route(String routingKey,
String superStream) |
void |
storeOffset(String reference,
String stream,
long offset) |
Client.Response |
subscribe(byte subscriptionId,
String stream,
OffsetSpecification offsetSpecification,
int credit)
Subscribe to receive messages from a stream.
|
Client.Response |
subscribe(byte subscriptionId,
String stream,
OffsetSpecification offsetSpecification,
int credit,
Map<String,String> properties)
Subscribe to receive messages from a stream.
|
Client.Response |
unsubscribe(byte subscriptionId) |
public static final int DEFAULT_PORT
public static final int DEFAULT_TLS_PORT
public Client()
public Client(Client.ClientParameters parameters)
public Client.Response create(String stream)
public Client.Response create(String stream, Map<String,String> arguments)
public Client.Response delete(String stream)
public Map<String,Client.StreamMetadata> metadata(String... streams)
public Client.Response declarePublisher(byte publisherId, String publisherReference, String stream)
public Client.Response deletePublisher(byte publisherId)
public List<Long> publish(byte publisherId, List<Message> messages, ToLongFunction<Object> publishSequenceFunction)
public List<Long> publish(byte publisherId, List<Message> messages, Client.OutboundEntityMappingCallback mappingCallback)
public List<Long> publish(byte publisherId, List<Message> messages, Client.OutboundEntityMappingCallback mappingCallback, ToLongFunction<Object> publishSequenceFunction)
public List<Long> publishBatches(byte publisherId, List<MessageBatch> messageBatches)
public List<Long> publishBatches(byte publisherId, List<MessageBatch> messageBatches, ToLongFunction<Object> publishSequenceFunction)
public List<Long> publishBatches(byte publisherId, List<MessageBatch> messageBatches, Client.OutboundEntityMappingCallback mappingCallback)
public List<Long> publishBatches(byte publisherId, List<MessageBatch> messageBatches, Client.OutboundEntityMappingCallback mappingCallback, ToLongFunction<Object> publishSequenceFunction)
public MessageBuilder messageBuilder()
public void credit(byte subscriptionId,
int credit)
public Client.Response subscribe(byte subscriptionId, String stream, OffsetSpecification offsetSpecification, int credit)
Note the offset is an unsigned long. Longs are signed in Java, but unsigned longs can be
used as long as some care is taken for some operations. See the unsigned* static
methods in Long.
subscriptionId - identifier to correlate inbound messages to this subscriptionstream - the stream to consume fromoffsetSpecification - the specification of the offset to consume fromcredit - the initial number of creditspublic Client.Response subscribe(byte subscriptionId, String stream, OffsetSpecification offsetSpecification, int credit, Map<String,String> properties)
Note the offset is an unsigned long. Longs are signed in Java, but unsigned longs can be
used as long as some care is taken for some operations. See the unsigned* static
methods in Long.
subscriptionId - identifier to correlate inbound messages to this subscriptionstream - the stream to consume fromoffsetSpecification - the specification of the offset to consume fromcredit - the initial number of creditsproperties - some optional properties to describe the subscriptionpublic Client.QueryOffsetResponse queryOffset(String reference, String stream)
public Client.Response unsubscribe(byte subscriptionId)
public void close()
close in interface AutoCloseablepublic boolean isOpen()
public SocketAddress localAddress()
public SocketAddress remoteAddress()
Copyright © 2022 VMware, Inc. or its affiliates.. All rights reserved.