Interface RqueueMessageEnqueuer

All Known Implementing Classes:
RqueueMessageEnqueuerImpl

public interface RqueueMessageEnqueuer
RqueueMessageEnqueuer enqueue message to Redis queue using different mechanism. Use any of the methods from this interface to enqueue message to any queue. Queue must exist, if a queue does not exist then it will throw an error of the QueueDoesNotExist. In such case register your queue using RqueueEndpointManager.registerQueue(String, String...) method.

There are four types of interfaces in this

enqueueXYZ : Messages enqueue using this method shall be consumed as soon as possible

enqueueInXYZ: Messages enqueue using enqueueInXYZ shall be consumed once the given time is elapsed, like in 30 seconds.

enqueueAtXYZ: Messages send using enqueueAtXYZ shall be consumed as soon as the given time is reached for example 3PM tomorrow.

enqueueUniqueXYZ: This method enqueue unique messages on a queue. New messages overwrite the existing message, the overwriting only works till the point message is not consumed, once message is consumed it's of no use. Uniqueness is only inside the queue.

  • Method Details

    • enqueue

      String enqueue(String queueName, Object message)
      Enqueue a message on given queue without any delay, consume as soon as possible.
      Parameters:
      queueName - on which queue message has to be send
      message - message object it could be any arbitrary object.
      Returns:
      message id on successful enqueue otherwise null.
    • enqueue

      boolean enqueue(String queueName, String messageId, Object message)
      Enqueue a message on given queue without any delay, consume as soon as possible.
      Parameters:
      queueName - on which queue message has to be send
      messageId - message id
      message - message object it could be any arbitrary object.
      Returns:
      message was enqueue successfully or failed.
    • enqueueUnique

      boolean enqueueUnique(String queueName, String messageId, Object message)
      Enqueue unique message on a given queue without any delay, consume as soon as possible.
      Parameters:
      queueName - on which queue message has to be send
      messageId - the message id for uniqueness
      message - message object it could be any arbitrary object.
      Returns:
      message id on successful enqueue otherwise null.
    • enqueueWithRetry

      String enqueueWithRetry(String queueName, Object message, int retryCount)
      Enqueue a message on the given queue with the given retry count. This message would not be consumed more than the specified time due to failure in underlying systems.
      Parameters:
      queueName - on which queue message has to be send
      message - message object it could be any arbitrary object.
      retryCount - how many times a message would be retried, before it can be discarded or send to dead letter queue configured using RqueueListener.numRetries()
      Returns:
      message id on successful enqueue otherwise null.
    • enqueueWithRetry

      boolean enqueueWithRetry(String queueName, String messageId, Object message, int retryCount)
      Enqueue a message on the given queue with the given retry count. This message would not be consumed more than the specified time due to failure in underlying systems.
      Parameters:
      queueName - on which queue message has to be send
      messageId - message id for this message.
      message - message object it could be any arbitrary object.
      retryCount - how many times a message would be retried, before it can be discarded or send to dead letter queue configured using RqueueListener.numRetries()
      Returns:
      message was enqueue successfully or failed.
    • enqueueWithPriority

      String enqueueWithPriority(String queueName, String priority, Object message)
      Enqueue a message on given queue, that will be consumed as soon as possible.
      Parameters:
      queueName - on which queue message has to be send
      priority - the priority for this message, like high, low, medium etc
      message - message object it could be any arbitrary object.
      Returns:
      message id on successful enqueue otherwise null.
    • enqueueWithPriority

      boolean enqueueWithPriority(String queueName, String priority, String messageId, Object message)
      Enqueue a message on given queue, that will be consumed as soon as possible.
      Parameters:
      queueName - on which queue message has to be send
      priority - the priority for this message, like high, low, medium etc
      messageId - the message id for this message
      message - message object it could be any arbitrary object.
      Returns:
      message was enqueued successfully or not.
    • enqueueUniqueWithPriority

      default boolean enqueueUniqueWithPriority(String queueName, String priority, String messageId, Object message)
      Enqueue unique message on given queue, that will be consumed as soon as possible.
      Parameters:
      queueName - on which queue message has to be send
      priority - the priority for this message, like high, low, medium etc
      messageId - the message id for this message
      message - message object it could be any arbitrary object.
      Returns:
      message was enqueue successfully or failed.
    • enqueueIn

      String enqueueIn(String queueName, Object message, long delayInMilliSecs)
      Schedule a message on the given queue with the provided delay. It will be available to consume as soon as the delay elapse, for example process in 10 seconds
      Parameters:
      queueName - on which queue message has to be send
      message - message object it could be any arbitrary object.
      delayInMilliSecs - delay in milliseconds
      Returns:
      message id on successful enqueue otherwise null.
    • enqueueIn

      boolean enqueueIn(String queueName, String messageId, Object message, long delayInMilliSecs)
      Schedule a message on the given queue with the provided delay. It will be available to consume as soon as the delay elapse.
      Parameters:
      queueName - on which queue message has to be send
      messageId - the message id, using which this message will be identified
      message - message object it could be any arbitrary object.
      delayInMilliSecs - delay in milliseconds
      Returns:
      message was enqueue successfully or failed.
    • enqueueIn

      default String enqueueIn(String queueName, Object message, Duration delay)
      Schedule a message on the given queue with the provided delay. It will be available to consume as soon as the delay elapse.
      Parameters:
      queueName - on which queue message has to be send
      message - message object it could be any arbitrary object.
      delay - time to wait before it can be executed.
      Returns:
      message id on successful enqueue otherwise null.
    • enqueueIn

      default boolean enqueueIn(String queueName, String messageId, Object message, Duration delay)
      Schedule a message on the given queue with the provided delay. It will be available to consume as soon as the delay elapse.
      Parameters:
      queueName - on which queue message has to be send
      messageId - the message id, using which this message will be identified
      message - message object it could be any arbitrary object.
      delay - time to wait before it can be executed.
      Returns:
      success or failure.
    • enqueueIn

      default String enqueueIn(String queueName, Object message, long delay, TimeUnit unit)
      Schedule a message on the given queue with the provided delay. It will be available to consume as soon as the specified delay elapse.
      Parameters:
      queueName - on which queue message has to be send
      message - message object it could be any arbitrary object.
      delay - time to wait before it can be executed.
      unit - unit of the delay
      Returns:
      message id on successful enqueue otherwise null.
    • enqueueIn

      default boolean enqueueIn(String queueName, String messageId, Object message, long delay, TimeUnit unit)
      Schedule a message on the given queue with the provided delay. It will be available to consume as soon as the specified delay elapse.
      Parameters:
      queueName - on which queue message has to be send
      messageId - message id using which this message can be identified
      message - message object it could be any arbitrary object.
      delay - time to wait before it can be executed.
      unit - unit of the delay
      Returns:
      success or failure.
    • enqueueUniqueIn

      boolean enqueueUniqueIn(String queueName, String messageId, Object message, long delayInMillisecond)
      Enqueue a message on given queue with delay, consume as soon as the scheduled is expired.
      Parameters:
      queueName - on which queue message has to be send
      messageId - the message id for uniqueness
      message - message object it could be any arbitrary object.
      delayInMillisecond - total execution delay
      Returns:
      message id on successful enqueue otherwise null.
    • enqueueInWithRetry

      String enqueueInWithRetry(String queueName, Object message, int retryCount, long delayInMilliSecs)
      Enqueue a task that would be scheduled to run in the specified milliseconds.
      Parameters:
      queueName - on which queue message has to be sent
      message - message object it could be any arbitrary object.
      retryCount - how many times a message would be retried, before it can be discarded or sent to dead letter queue configured using RqueueListener.numRetries() ()}
      delayInMilliSecs - delay in milliseconds, this message would be only visible to the listener when number of millisecond has elapsed.
      Returns:
      message id on successful enqueue otherwise null
    • enqueueInWithRetry

      boolean enqueueInWithRetry(String queueName, String messageId, Object message, int retryCount, long delayInMilliSecs)
      Enqueue a task that would be scheduled to run in the specified milliseconds.
      Parameters:
      queueName - on which queue message has to be sent
      messageId - the message identifier
      message - message object it could be any arbitrary object.
      retryCount - how many times a message would be retried, before it can be discarded or sent to dead letter queue configured using RqueueListener.numRetries() ()}
      delayInMilliSecs - delay in milliseconds, this message would be only visible to the listener when number of millisecond has elapsed.
      Returns:
      message was enqueue successfully or failed.
    • enqueueInWithPriority

      default String enqueueInWithPriority(String queueName, String priority, Object message, long delayInMilliSecs)
      Schedule a message on the given queue at the provided time. It will be executed as soon as the given delay is elapse.
      Parameters:
      queueName - on which queue message has to be send
      priority - the name of the priority level
      message - message object it could be any arbitrary object.
      delayInMilliSecs - delay in milliseconds
      Returns:
      message id on successful enqueue otherwise null.
    • enqueueInWithPriority

      default boolean enqueueInWithPriority(String queueName, String priority, String messageId, Object message, long delayInMilliSecs)
      Schedule a message on the given queue at the provided time. It will be executed as soon as the given delay is elapse.
      Parameters:
      queueName - on which queue message has to be send
      priority - the name of the priority level
      messageId - the message id
      message - message object it could be any arbitrary object.
      delayInMilliSecs - delay in milliseconds
      Returns:
      message was enqueue successfully or failed.
    • enqueueInWithPriority

      default String enqueueInWithPriority(String queueName, String priority, Object message, Duration delay)
      Schedule a message on the given queue at the provided time. It will be executed as soon as the given delay is elapse.
      Parameters:
      queueName - on which queue message has to be send
      priority - the name of the priority level
      message - message object it could be any arbitrary object.
      delay - time to wait before it can be consumed.
      Returns:
      message id on successful enqueue otherwise null.
    • enqueueInWithPriority

      default boolean enqueueInWithPriority(String queueName, String priority, String messageId, Object message, Duration delay)
      Schedule a message on the given queue at the provided time. It will be executed as soon as the given delay is elapse.
      Parameters:
      queueName - on which queue message has to be send
      priority - the name of the priority level
      messageId - the message id
      message - message object it could be any arbitrary object.
      delay - time to wait before it can be consumed.
      Returns:
      message was enqueue successfully or failed.
    • enqueueInWithPriority

      default String enqueueInWithPriority(String queueName, String priority, Object message, long delay, TimeUnit unit)
      Schedule a message on the given queue at the provided time. It will be executed as soon as the given delay is elapse.
      Parameters:
      queueName - on which queue message has to be send
      priority - the name of the priority level
      message - message object it could be any arbitrary object.
      delay - time to wait before it can be consumed.
      unit - unit of the delay
      Returns:
      message id on a successful enqueue otherwise null.
    • enqueueInWithPriority

      default boolean enqueueInWithPriority(String queueName, String priority, String messageId, Object message, long delay, TimeUnit unit)
      Schedule a message on the given queue at the provided time. It will be executed as soon as the given delay is elapse.
      Parameters:
      queueName - on which queue message has to be send
      priority - the name of the priority level
      messageId - the message id
      message - message object it could be any arbitrary object.
      delay - time to wait before it can be consumed.
      unit - unit of the delay
      Returns:
      message was enqueue successfully or failed.
    • enqueueUniqueInWithPriority

      default boolean enqueueUniqueInWithPriority(String queueName, String priority, String messageId, Object message, long delay, TimeUnit unit)
      Schedule unique message on the given queue at the provided time. It will be executed as soon as the given delay is elapse.
      Parameters:
      queueName - on which queue message has to be send
      priority - the name of the priority level
      messageId - the message id
      message - message object it could be any arbitrary object.
      delay - time to wait before it can be consumed.
      unit - unit of the delay
      Returns:
      message was enqueue successfully or failed.
    • enqueueAt

      default String enqueueAt(String queueName, Object message, long startTimeInMilliSeconds)
      Schedule a message on the given queue at the provided time. It will be available to consume as soon as the given time is reached.
      Parameters:
      queueName - on which queue message has to be send
      message - message object it could be any arbitrary object.
      startTimeInMilliSeconds - time at which this message has to be consumed.
      Returns:
      message id on successful enqueue otherwise null.
    • enqueueAt

      default boolean enqueueAt(String queueName, String messageId, Object message, long startTimeInMilliSeconds)
      Schedule a message on the given queue at the provided time. It will be available to consume as soon as the given time is reached.
      Parameters:
      queueName - on which queue message has to be send
      messageId - message id
      message - message object it could be any arbitrary object.
      startTimeInMilliSeconds - time at which this message has to be consumed.
      Returns:
      message was enqueued successfully or failed.
    • enqueueAt

      default String enqueueAt(String queueName, Object message, Instant starTime)
      Schedule a message on the given queue at the provided time. It will be available to consume as soon as the given time is reached.
      Parameters:
      queueName - on which queue message has to be send
      message - message object it could be any arbitrary object.
      starTime - time at which this message has to be consumed.
      Returns:
      message id on successful enqueue otherwise null.
    • enqueueAt

      default boolean enqueueAt(String queueName, String messageId, Object message, Instant starTime)
      Schedule a message on the given queue at the provided time. It will be available to consume as soon as the given time is reached.
      Parameters:
      queueName - on which queue message has to be send
      messageId - the message id
      message - message object it could be any arbitrary object.
      starTime - time at which this message has to be consumed.
      Returns:
      message was enqueued successfully or failed.
    • enqueueAt

      default String enqueueAt(String queueName, Object message, Date starTime)
      Schedule a message on the given queue at the provided time. It will be available to consume as soon as the given time is reached.
      Parameters:
      queueName - on which queue message has to be send
      message - message object it could be any arbitrary object.
      starTime - time at which this message has to be consumed.
      Returns:
      message id on successful enqueue otherwise null.
    • enqueueAt

      default boolean enqueueAt(String queueName, String messageId, Object message, Date starTime)
      Schedule a message on the given queue at the provided time. It will be available to consume as soon as the given time is reached.
      Parameters:
      queueName - on which queue message has to be send
      messageId - the message id
      message - message object it could be any arbitrary object.
      starTime - time at which this message has to be consumed.
      Returns:
      message was enqueued successfully or failed.
    • enqueueUniqueAt

      default boolean enqueueUniqueAt(String queueName, String messageId, Object message, long timeInMilliSeconds)
      Schedule unique messages on the given queue at the provided time. It will be available to consume as soon as the given time is reached.
      Parameters:
      queueName - on which queue message has to be send
      messageId - a unique identifier for this message
      message - message object it could be any arbitrary object.
      timeInMilliSeconds - time at which this message has to be consumed.
      Returns:
      message was enqueue successfully or failed.
    • enqueueAtWithPriority

      default String enqueueAtWithPriority(String queueName, String priority, Object message, long startTimeInMilliSecond)
      Schedule a message on the given queue at the provided time. It will be executed as soon as the given time is reached, time must be in the future.
      Parameters:
      queueName - on which queue message has to be send
      priority - the name of the priority level
      message - message object it could be any arbitrary object.
      startTimeInMilliSecond - time at which the message would be consumed.
      Returns:
      message id on successful enqueue otherwise null.
    • enqueueAtWithPriority

      default boolean enqueueAtWithPriority(String queueName, String priority, String messageId, Object message, long startTimeInMilliSecond)
      Schedule a message on the given queue at the provided time. It will be executed as soon as the given time is reached, time must be in the future.
      Parameters:
      queueName - on which queue message has to be send
      priority - the name of the priority level
      messageId - the message id
      message - message object it could be any arbitrary object.
      startTimeInMilliSecond - time at which the message would be consumed.
      Returns:
      message was enqueue successfully or failed.
    • enqueueAtWithPriority

      default String enqueueAtWithPriority(String queueName, String priority, Object message, Instant startTime)
      Schedule a message on the given queue at the provided time. It will be executed as soon as the given time is reached, time must be in the future.
      Parameters:
      queueName - on which queue message has to be send
      priority - the name of the priority level
      message - message object it could be any arbitrary object.
      startTime - time at which message is supposed to consume
      Returns:
      message id on successful enqueue otherwise null
    • enqueueAtWithPriority

      default boolean enqueueAtWithPriority(String queueName, String priority, String messageId, Object message, Instant instant)
      Schedule a message on the given queue at the provided time. It will be executed as soon as the given time is reached, time must be in the future.
      Parameters:
      queueName - on which queue message has to be send
      priority - the name of the priority level
      messageId - the message id
      message - message object it could be any arbitrary object.
      instant - time at which message is supposed to consume
      Returns:
      message was enqueue successfully or failed.
    • enqueueAtWithPriority

      default String enqueueAtWithPriority(String queueName, String priority, Object message, Date time)
      Schedule a message on the given queue at the provided time. It will be executed as soon as the given time is reached, time must be in the future.
      Parameters:
      queueName - on which queue message has to be send
      priority - the name of the priority level
      message - message object it could be any arbitrary object.
      time - time at which message would be consumed.
      Returns:
      a message id on successful enqueue otherwise null
    • enqueueAtWithPriority

      default boolean enqueueAtWithPriority(String queueName, String priority, String messageId, Object message, Date time)
      Schedule a message on the given queue at the provided time. It will be executed as soon as the given time is reached, time must be in the future.
      Parameters:
      queueName - on which queue message has to be send
      priority - the name of the priority level
      messageId - the message id
      message - message object it could be any arbitrary object.
      time - time at which message would be consumed.
      Returns:
      message was enqueue successfully or failed.
    • enqueueUniqueAtWithPriority

      default boolean enqueueUniqueAtWithPriority(String queueName, String priority, String messageId, Object message, long timeInMilliSeconds)
      Schedule unique messages on the given queue at the provided time. It will be available to consume as soon as the given time is reached.
      Parameters:
      queueName - on which queue message has to be send
      priority - priority of the given message
      messageId - a unique identifier message id for this message
      message - message object it could be any arbitrary object.
      timeInMilliSeconds - time at which this message has to be consumed.
      Returns:
      message was enqueue successfully or failed.
    • enqueuePeriodic

      String enqueuePeriodic(String queueName, Object message, long periodInMilliSeconds)
      Enqueue a message on given queue that will be running after a given period. It works like periodic cron that's scheduled at certain interval, for example every 30 seconds.
      Parameters:
      queueName - on which queue message has to be send
      message - message object it could be any arbitrary object.
      periodInMilliSeconds - period of this job in milliseconds.
      Returns:
      message id on successful enqueue otherwise null.
    • enqueuePeriodic

      default String enqueuePeriodic(String queueName, Object message, long period, TimeUnit unit)
      Enqueue a message on given queue that will be running after a given period. It works like periodic cron that's scheduled at certain interval, for example every 30 seconds.
      Parameters:
      queueName - on which queue message has to be send
      message - message object it could be any arbitrary object.
      period - period of this job
      unit - period unit
      Returns:
      message id on successful enqueue otherwise null.
    • enqueuePeriodic

      default String enqueuePeriodic(String queueName, Object message, Duration period)
      Enqueue a message on given queue that will be running after a given period. It works like periodic cron that's scheduled at certain interval, for example every 30 seconds.
      Parameters:
      queueName - on which queue message has to be send
      message - message object it could be any arbitrary object.
      period - job period
      Returns:
      message id on successful enqueue otherwise null.
    • enqueuePeriodic

      boolean enqueuePeriodic(String queueName, String messageId, Object message, long periodInMilliSeconds)
      Enqueue a message on given queue that will be running after a given period. It works like periodic cron that's scheduled at certain interval, for example every 30 seconds.
      Parameters:
      queueName - on which queue message has to be send
      messageId - message id corresponding to this message
      message - message object it could be any arbitrary object.
      periodInMilliSeconds - period of this job in milliseconds.
      Returns:
      success or failure
    • enqueuePeriodic

      default boolean enqueuePeriodic(String queueName, String messageId, Object message, long period, TimeUnit unit)
      Enqueue a message on given queue that will be running after a given period. It works like periodic cron that's scheduled at certain interval, for example every 30 seconds.
      Parameters:
      queueName - on which queue message has to be send
      messageId - message id corresponding to this message
      message - message object it could be any arbitrary object.
      period - period of this job .
      unit - unit of this period
      Returns:
      success or failure
    • enqueuePeriodic

      default boolean enqueuePeriodic(String queueName, String messageId, Object message, Duration period)
      Enqueue a message on given queue that will be running after a given period. It works like periodic cron that's scheduled at certain interval, for example every 30 seconds.
      Parameters:
      queueName - on which queue message has to be send
      messageId - message id corresponding to this message
      message - message object it could be any arbitrary object.
      period - period of this job .
      Returns:
      success or failure
    • getMessageConverter

      org.springframework.messaging.converter.MessageConverter getMessageConverter()