Interface KeyExtractor (1.13.7)

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
Type Description
KeyExtractor

Methods

extractKey(PubsubMessage message)

public abstract ByteString extractKey(PubsubMessage message)

Extract the ByteString routing key from a PubsubMessage.

Parameter
Name Description
message com.google.pubsub.v1.PubsubMessage
Returns
Type Description
ByteString
Exceptions
Type Description
ApiException