Interface KeyExtractor


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.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final KeyExtractor
    An extractor that gets the routing key from the ordering key field.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.protobuf.ByteString
    extractKey(com.google.pubsub.v1.PubsubMessage message)
    Extract the ByteString routing key from a PubsubMessage.
  • Field Details

    • DEFAULT

      static final KeyExtractor DEFAULT
      An extractor that gets the routing key from the ordering key field.
  • Method Details

    • extractKey

      com.google.protobuf.ByteString extractKey(com.google.pubsub.v1.PubsubMessage message) throws com.google.api.gax.rpc.ApiException
      Extract the ByteString routing key from a PubsubMessage.
      Throws:
      com.google.api.gax.rpc.ApiException