Record Class Redrive.Options

java.lang.Object
java.lang.Record
com.babelqueue.Redrive.Options
Record Components:
toQueue - overrides the target queue (sandbox/redirect); when blank, each message goes back to its own dead_letter.original_queue
max - caps how many messages are pulled from the DLQ (0 = all available)
dryRun - inspect and report the plan, restoring every message unchanged
select - picks which messages to redrive (unselected are restored unchanged)
bypass - stamps the bq-replay-bypass header on each redriven message (see Replay); a no-op unless the transport is a Redrive.HeaderPublisher
Enclosing class:
Redrive

public static record Redrive.Options(String toQueue, int max, boolean dryRun, Predicate<Envelope> select, boolean bypass) extends Record
  • Constructor Details

    • Options

      public Options(String toQueue, int max, boolean dryRun, Predicate<Envelope> select, boolean bypass)
      Creates an instance of a Options record class.
      Parameters:
      toQueue - the value for the toQueue record component
      max - the value for the max record component
      dryRun - the value for the dryRun record component
      select - the value for the select record component
      bypass - the value for the bypass record component
  • Method Details

    • all

      public static Redrive.Options all()
      Redrive every message back to its source queue.
    • toQueue

      public Redrive.Options toQueue(String queue)
    • max

      public Redrive.Options max(int limit)
    • dryRun

      public Redrive.Options dryRun(boolean enabled)
    • select

      public Redrive.Options select(Predicate<Envelope> predicate)
    • bypass

      public Redrive.Options bypass(boolean enabled)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • toQueue

      public String toQueue()
      Returns the value of the toQueue record component.
      Returns:
      the value of the toQueue record component
    • max

      public int max()
      Returns the value of the max record component.
      Returns:
      the value of the max record component
    • dryRun

      public boolean dryRun()
      Returns the value of the dryRun record component.
      Returns:
      the value of the dryRun record component
    • select

      public Predicate<Envelope> select()
      Returns the value of the select record component.
      Returns:
      the value of the select record component
    • bypass

      public boolean bypass()
      Returns the value of the bypass record component.
      Returns:
      the value of the bypass record component