Interface KeyExtractor (1.10.0)

public interface KeyExtractor

A KeyExtractor can extract the Pub/Sub Lite 'key' field used for message routing from a PubsubMessage. It will by default use the ordering_key field directly for this if it exists.

An empty ByteString implies that the message should have no ordering key.

Static Fields

DEFAULT

public static final KeyExtractor DEFAULT

An extractor that gets the routing key from the ordering key field.

Field Value
TypeDescription
KeyExtractor

Methods

extractKey(PubsubMessage message)

public abstract ByteString extractKey(PubsubMessage message)

Extract the ByteString routing key from a PubsubMessage.

Parameter
NameDescription
messagecom.google.pubsub.v1.PubsubMessage
Returns
TypeDescription
ByteString
Exceptions
TypeDescription
ApiException