Class QueueDestination

java.lang.Object
io.github.flink.gcp.connector.cloudtasks.sink.QueueDestination
All Implemented Interfaces:
Serializable

@Public public final class QueueDestination extends Object implements Serializable
A fully-qualified Cloud Tasks queue reference: project, location and queue.

The location is part of the identity because queues are regional and one project may hold queues in several regions.

Instances are pure queue identity: equals(Object) and hashCode() are defined over exactly (project, location, queue). Queue configuration — the rate limits and the retry policy that pace dispatch — is not expressible here: it belongs to the queue itself and is applied by whoever creates it, not by this sink.

Instances are immutable; the resource path and hash are precomputed, so they are cheap to use on the per-record write path. Resolvers should still cache and reuse instances instead of re-creating them per record.

See Also:
  • Method Details

    • of

      public static QueueDestination of(String project, String location, String queue)
      Creates a QueueDestination from bare ids, not resource paths.
      Parameters:
      project - the Google Cloud project id
      location - the queue's location (for example asia-northeast1)
      queue - the queue id
      Returns:
      the destination
      Throws:
      IllegalArgumentException - if a component is null or blank, has leading or trailing whitespace, or contains '/' — a separator would make the composed resource path address a different resource
    • getProject

      public String getProject()
      Returns the Google Cloud project id, given as a bare id rather than a resource path.
    • getLocation

      public String getLocation()
      Returns the queue's location — the Google Cloud region, such as asia-northeast1, that holds the queue.
    • getQueue

      public String getQueue()
      Returns the queue id, given as a bare id rather than a resource path.
    • toQueuePath

      public String toQueuePath()
      Returns the queue path in the projects/PROJECT/locations/LOCATION/queues/QUEUE form used by the Cloud Tasks API.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object