Package com.rabbitmq.stream.impl
Class Client
java.lang.Object
com.rabbitmq.stream.impl.Client
- All Implemented Interfaces:
AutoCloseable
This is low-level client API to communicate with the broker.
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
static class
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static class
static class
static class
static interface
static class
static class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
consumerUpdateResponse
(int correlationId, short responseCode, OffsetSpecification offsetSpecification) void
credit
(byte subscriptionId, int credit) declarePublisher
(byte publisherId, String publisherReference, String stream) deletePublisher
(byte publisherId) boolean
boolean
isOpen()
partitions
(String superStream) publish
(byte publisherId, List<Message> messages, Client.OutboundEntityMappingCallback mappingCallback) publish
(byte publisherId, List<Message> messages, Client.OutboundEntityMappingCallback mappingCallback, ToLongFunction<Object> publishSequenceFunction) publish
(byte publisherId, List<Message> messages, ToLongFunction<Object> publishSequenceFunction) publishBatches
(byte publisherId, List<MessageBatch> messageBatches) publishBatches
(byte publisherId, List<MessageBatch> messageBatches, Client.OutboundEntityMappingCallback mappingCallback) publishBatches
(byte publisherId, List<MessageBatch> messageBatches, Client.OutboundEntityMappingCallback mappingCallback, ToLongFunction<Object> publishSequenceFunction) publishBatches
(byte publisherId, List<MessageBatch> messageBatches, ToLongFunction<Object> publishSequenceFunction) queryOffset
(String reference, String stream) long
queryPublisherSequence
(String publisherReference, String stream) void
storeOffset
(String reference, String stream, long offset) subscribe
(byte subscriptionId, String stream, OffsetSpecification offsetSpecification, int credit) Subscribe to receive messages from a stream.subscribe
(byte subscriptionId, String stream, OffsetSpecification offsetSpecification, int initialCredits, Map<String, String> properties) Subscribe to receive messages from a stream.toString()
unsubscribe
(byte subscriptionId)
-
Field Details
-
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
DEFAULT_TLS_PORT
public static final int DEFAULT_TLS_PORT- See Also:
-
-
Constructor Details
-
Client
public Client() -
Client
-
-
Method Details
-
create
-
create
-
delete
-
metadata
-
declarePublisher
-
deletePublisher
-
publish
-
publish
-
publish
public List<Long> publish(byte publisherId, List<Message> messages, Client.OutboundEntityMappingCallback mappingCallback) -
publish
public List<Long> publish(byte publisherId, List<Message> messages, Client.OutboundEntityMappingCallback mappingCallback, ToLongFunction<Object> publishSequenceFunction) -
publishBatches
-
publishBatches
public List<Long> publishBatches(byte publisherId, List<MessageBatch> messageBatches, ToLongFunction<Object> publishSequenceFunction) -
publishBatches
public List<Long> publishBatches(byte publisherId, List<MessageBatch> messageBatches, Client.OutboundEntityMappingCallback mappingCallback) -
publishBatches
public List<Long> publishBatches(byte publisherId, List<MessageBatch> messageBatches, Client.OutboundEntityMappingCallback mappingCallback, ToLongFunction<Object> publishSequenceFunction) -
messageBuilder
-
credit
public void credit(byte subscriptionId, int credit) -
subscribe
public Client.Response subscribe(byte subscriptionId, String stream, OffsetSpecification offsetSpecification, int credit) Subscribe to receive messages from a stream.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 inLong
.- Parameters:
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 credits- Returns:
- the subscription confirmation
-
subscribe
public Client.Response subscribe(byte subscriptionId, String stream, OffsetSpecification offsetSpecification, int initialCredits, Map<String, String> properties) Subscribe to receive messages from a stream.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 inLong
.- Parameters:
subscriptionId
- identifier to correlate inbound messages to this subscriptionstream
- the stream to consume fromoffsetSpecification
- the specification of the offset to consume frominitialCredits
- the initial number of creditsproperties
- some optional properties to describe the subscription- Returns:
- the subscription confirmation
-
storeOffset
-
queryOffset
-
queryPublisherSequence
-
unsubscribe
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
isOpen
public boolean isOpen() -
filteringSupported
public boolean filteringSupported() -
route
-
partitions
-
consumerUpdateResponse
public void consumerUpdateResponse(int correlationId, short responseCode, OffsetSpecification offsetSpecification) -
localAddress
-
remoteAddress
-
brokerVersion
-
toString
-