Annotation Interface Timeout


@Documented @Target(TYPE) @Retention(RUNTIME) @Inherited public @interface Timeout
Annotation to be placed on requests (i.e. queries and commands). Configures the time before such request will time out when sent using sendAndWait-like methods.

Note that non-blocking requests sent using send-methods that return a CompletableFuture will *not* time out automatically. If a timeout is desired on non-blocking requests this needs to be manually configured, e.g. via CompletableFuture.orTimeout(long, TimeUnit).

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    int
    Configures the maximum number of time units before a request with this annotation will time out.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Returns the time unit for value().
  • Element Details

    • value

      int value
      Configures the maximum number of time units before a request with this annotation will time out.
    • timeUnit

      TimeUnit timeUnit
      Returns the time unit for value(). Defaults to TimeUnit.MILLISECONDS.
      Default:
      MILLISECONDS