Class XAddArgs

java.lang.Object
io.quarkus.redis.datasource.stream.XAddArgs
All Implemented Interfaces:
RedisCommandExtraArguments

public class XAddArgs extends Object implements RedisCommandExtraArguments
The argument of the XADD command.
  • Constructor Details

    • XAddArgs

      public XAddArgs()
  • Method Details

    • id

      public XAddArgs id(String id)
      Sets the stream id to identify a given entry inside a stream. If not set, the stream id is generated by the Redis server.
      Parameters:
      id - the id, must not be null, but be formed by two numbers separated by a -. In general, the first number is a timestamp.
      Returns:
      the current XAddArgs
    • maxlen

      public XAddArgs maxlen(Long maxlen)
      Sets the max length of the stream. When XADD is called with this parameter, the new entry is added to the stream, but if the max size is reached, the oldest entry is evicted.
      Parameters:
      maxlen - the max length of the stream, must be positive
      Returns:
      the current XAddArgs
    • nearlyExactTrimming

      public XAddArgs nearlyExactTrimming()
      When set, prefix the maxlen with ~ to enable the almost exact trimming. This is recommended when using maxlen(Long).
      Returns:
      the current XAddArgs
    • nomkstream

      public XAddArgs nomkstream()
      Do not create a new stream if the stream does not exist yet.
      Returns:
      the current XAddArgs
    • minid

      public XAddArgs minid(String minid)
      Evicts entries from the stream having IDs lower to the specified one.
      Parameters:
      minid - the min id, must not be null, must be a valid stream id
      Returns:
      the current XAddArgs
    • limit

      public XAddArgs limit(long limit)
      Sets the maximum entries that can get evicted.
      Parameters:
      limit - the limit, must be positive
      Returns:
      the current XAddArgs
    • toArgs

      public List<Object> toArgs()
      Specified by:
      toArgs in interface RedisCommandExtraArguments
      Returns:
      the list of arguments.