Class EsbTrigger

java.lang.Object
com.kingsrook.qqq.esb.model.EsbTrigger

public class EsbTrigger extends Object
A trigger that runs a process from messages on an ESB queue or topic. A trigger doesn't know its process's name (it lives in the process's EsbProcessMetaData), so the derived names take it as a parameter: - name: processName.destinationName (the QQQ destination name). - subscriptionName (topics only): defaults to processName.X, where X is the destination's broker-side name (QEsbDestinationMetaData getEffectiveDestinationName). - deadLetterDestinationName: defaults to X.dlq for a queue, or X.subscriptionName.dlq for a topic (X again being the broker-side name). The subscription and dead-letter names are names on the broker. When the destination has no separate broker-side name, X is its QQQ name, and the default subscription name is the same as the trigger's name. Other defaults are per spec section 3. batchSize and batchWaitMs are left unset unless given (so validation can reject them in SINGLE mode); use getEffectiveBatchSize and getEffectiveBatchWaitMs for their values.
  • Field Details

    • DEFAULT_BATCH_SIZE

      public static final Integer DEFAULT_BATCH_SIZE
    • DEFAULT_BATCH_WAIT_MS

      public static final Integer DEFAULT_BATCH_WAIT_MS
  • Constructor Details

    • EsbTrigger

      public EsbTrigger()
  • Method Details

    • getName

      public String getName(String processName)
      The trigger's name: processName.destinationName
    • getEffectiveSubscriptionName

      public String getEffectiveSubscriptionName(String processName)
      The shared durable subscription name (topic triggers): subscriptionName if set, else processName.X, where X is the broker-side name of this trigger's destination, which is looked up in the ESB meta-data of the QContext's instance (so, on a thread of your own, call this after QContext.init, or use the overload that takes the destination). Throws QRuntimeException if a default is needed but the destination can't be found there.
    • getEffectiveSubscriptionName

      public String getEffectiveSubscriptionName(String processName, QEsbDestinationMetaData destination)
      The shared durable subscription name (topic triggers), given this trigger's destination: subscriptionName if set, else processName.X, where X is the destination's broker-side name.
    • getEffectiveDeadLetterDestinationName

      public String getEffectiveDeadLetterDestinationName(String processName)
      The dead-letter destination (broker queue) name: deadLetterDestinationName if set, else the default for this trigger's destination, which is looked up in the ESB meta-data of the QContext's instance (so, on a thread of your own, call this after QContext.init, or use the overload that takes the destination). Throws QRuntimeException if a default is needed but the destination can't be found there.
    • getEffectiveDeadLetterDestinationName

      public String getEffectiveDeadLetterDestinationName(String processName, QEsbDestinationMetaData destination)
      The dead-letter destination (broker queue) name, given this trigger's destination: deadLetterDestinationName if set, else X.dlq for a queue, or X.effectiveSubscriptionName.dlq for a topic, where X is the destination's broker-side name.
    • getEffectiveBatchSize

      public Integer getEffectiveBatchSize()
      batchSize if set, else the default (100).
    • getEffectiveBatchWaitMs

      public Integer getEffectiveBatchWaitMs()
      batchWaitMs if set, else the default (1000).
    • getDestinationName

      public String getDestinationName()
      Getter for destinationName
    • setDestinationName

      public void setDestinationName(String destinationName)
      Setter for destinationName
    • withDestinationName

      public EsbTrigger withDestinationName(String destinationName)
      Fluent setter for destinationName
    • getSubscriptionName

      public String getSubscriptionName()
      Getter for subscriptionName. See also getEffectiveSubscriptionName.
    • setSubscriptionName

      public void setSubscriptionName(String subscriptionName)
      Setter for subscriptionName
    • withSubscriptionName

      public EsbTrigger withSubscriptionName(String subscriptionName)
      Fluent setter for subscriptionName
    • getMode

      public EsbTriggerMode getMode()
      Getter for mode
    • setMode

      public void setMode(EsbTriggerMode mode)
      Setter for mode
    • withMode

      public EsbTrigger withMode(EsbTriggerMode mode)
      Fluent setter for mode
    • getBatchSize

      public Integer getBatchSize()
      Getter for batchSize (null unless set). See also getEffectiveBatchSize.
    • setBatchSize

      public void setBatchSize(Integer batchSize)
      Setter for batchSize
    • withBatchSize

      public EsbTrigger withBatchSize(Integer batchSize)
      Fluent setter for batchSize
    • getBatchWaitMs

      public Integer getBatchWaitMs()
      Getter for batchWaitMs (null unless set). See also getEffectiveBatchWaitMs.
    • setBatchWaitMs

      public void setBatchWaitMs(Integer batchWaitMs)
      Setter for batchWaitMs
    • withBatchWaitMs

      public EsbTrigger withBatchWaitMs(Integer batchWaitMs)
      Fluent setter for batchWaitMs
    • getConcurrency

      public Integer getConcurrency()
      Getter for concurrency
    • setConcurrency

      public void setConcurrency(Integer concurrency)
      Setter for concurrency
    • withConcurrency

      public EsbTrigger withConcurrency(Integer concurrency)
      Fluent setter for concurrency
    • getMaxAttempts

      public Integer getMaxAttempts()
      Getter for maxAttempts
    • setMaxAttempts

      public void setMaxAttempts(Integer maxAttempts)
      Setter for maxAttempts
    • withMaxAttempts

      public EsbTrigger withMaxAttempts(Integer maxAttempts)
      Fluent setter for maxAttempts
    • getRetryDelayMs

      public Integer getRetryDelayMs()
      Getter for retryDelayMs
    • setRetryDelayMs

      public void setRetryDelayMs(Integer retryDelayMs)
      Setter for retryDelayMs
    • withRetryDelayMs

      public EsbTrigger withRetryDelayMs(Integer retryDelayMs)
      Fluent setter for retryDelayMs
    • getRetryMultiplier

      public Double getRetryMultiplier()
      Getter for retryMultiplier
    • setRetryMultiplier

      public void setRetryMultiplier(Double retryMultiplier)
      Setter for retryMultiplier
    • withRetryMultiplier

      public EsbTrigger withRetryMultiplier(Double retryMultiplier)
      Fluent setter for retryMultiplier
    • getRetryMaxDelayMs

      public Integer getRetryMaxDelayMs()
      Getter for retryMaxDelayMs
    • setRetryMaxDelayMs

      public void setRetryMaxDelayMs(Integer retryMaxDelayMs)
      Setter for retryMaxDelayMs
    • withRetryMaxDelayMs

      public EsbTrigger withRetryMaxDelayMs(Integer retryMaxDelayMs)
      Fluent setter for retryMaxDelayMs
    • getOnDeadLetter

      public EsbDeadLetterAction getOnDeadLetter()
      Getter for onDeadLetter
    • setOnDeadLetter

      public void setOnDeadLetter(EsbDeadLetterAction onDeadLetter)
      Setter for onDeadLetter
    • withOnDeadLetter

      public EsbTrigger withOnDeadLetter(EsbDeadLetterAction onDeadLetter)
      Fluent setter for onDeadLetter
    • getDeadLetterDestinationName

      public String getDeadLetterDestinationName()
      Getter for deadLetterDestinationName. See also getEffectiveDeadLetterDestinationName.
    • setDeadLetterDestinationName

      public void setDeadLetterDestinationName(String deadLetterDestinationName)
      Setter for deadLetterDestinationName
    • withDeadLetterDestinationName

      public EsbTrigger withDeadLetterDestinationName(String deadLetterDestinationName)
      Fluent setter for deadLetterDestinationName
    • getRunAsSessionSupplier

      public QCodeReference getRunAsSessionSupplier()
      Getter for runAsSessionSupplier - a Supplier; null means the system user session.
    • setRunAsSessionSupplier

      public void setRunAsSessionSupplier(QCodeReference runAsSessionSupplier)
      Setter for runAsSessionSupplier
    • withRunAsSessionSupplier

      public EsbTrigger withRunAsSessionSupplier(QCodeReference runAsSessionSupplier)
      Fluent setter for runAsSessionSupplier
    • getTimeoutMs

      public Integer getTimeoutMs()
      Getter for timeoutMs (per run; null means no timeout)
    • setTimeoutMs

      public void setTimeoutMs(Integer timeoutMs)
      Setter for timeoutMs
    • withTimeoutMs

      public EsbTrigger withTimeoutMs(Integer timeoutMs)
      Fluent setter for timeoutMs
    • getStartPaused

      public Boolean getStartPaused()
      Getter for startPaused
    • setStartPaused

      public void setStartPaused(Boolean startPaused)
      Setter for startPaused
    • withStartPaused

      public EsbTrigger withStartPaused(Boolean startPaused)
      Fluent setter for startPaused