Package com.github.sonus21.rqueue.core
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 Summary
Modifier and TypeMethodDescriptionEnqueue a message on given queue without any delay, consume as soon as possible.booleanEnqueue a message on given queue without any delay, consume as soon as possible.default StringSchedule a message on the given queue at the provided time.default StringSchedule a message on the given queue at the provided time.default StringSchedule a message on the given queue at the provided time.default booleanSchedule a message on the given queue at the provided time.default booleanSchedule a message on the given queue at the provided time.default booleanSchedule a message on the given queue at the provided time.default StringenqueueAtWithPriority(String queueName, String priority, Object message, long startTimeInMilliSecond) Schedule a message on the given queue at the provided time.default StringenqueueAtWithPriority(String queueName, String priority, Object message, Instant startTime) Schedule a message on the given queue at the provided time.default StringenqueueAtWithPriority(String queueName, String priority, Object message, Date time) Schedule a message on the given queue at the provided time.default booleanenqueueAtWithPriority(String queueName, String priority, String messageId, Object message, long startTimeInMilliSecond) Schedule a message on the given queue at the provided time.default booleanenqueueAtWithPriority(String queueName, String priority, String messageId, Object message, Instant instant) Schedule a message on the given queue at the provided time.default booleanenqueueAtWithPriority(String queueName, String priority, String messageId, Object message, Date time) Schedule a message on the given queue at the provided time.Schedule a message on the given queue with the provided delay.default StringSchedule a message on the given queue with the provided delay.default StringSchedule a message on the given queue with the provided delay.booleanSchedule a message on the given queue with the provided delay.default booleanSchedule a message on the given queue with the provided delay.default booleanSchedule a message on the given queue with the provided delay.default StringenqueueInWithPriority(String queueName, String priority, Object message, long delayInMilliSecs) Schedule a message on the given queue at the provided time.default StringenqueueInWithPriority(String queueName, String priority, Object message, long delay, TimeUnit unit) Schedule a message on the given queue at the provided time.default StringenqueueInWithPriority(String queueName, String priority, Object message, Duration delay) Schedule a message on the given queue at the provided time.default booleanenqueueInWithPriority(String queueName, String priority, String messageId, Object message, long delayInMilliSecs) Schedule a message on the given queue at the provided time.default booleanenqueueInWithPriority(String queueName, String priority, String messageId, Object message, long delay, TimeUnit unit) Schedule a message on the given queue at the provided time.default booleanenqueueInWithPriority(String queueName, String priority, String messageId, Object message, Duration delay) Schedule a message on the given queue at the provided time.enqueueInWithRetry(String queueName, Object message, int retryCount, long delayInMilliSecs) Enqueue a task that would be scheduled to run in the specified milliseconds.booleanenqueueInWithRetry(String queueName, String messageId, Object message, int retryCount, long delayInMilliSecs) Enqueue a task that would be scheduled to run in the specified milliseconds.enqueuePeriodic(String queueName, Object message, long periodInMilliSeconds) Enqueue a message on given queue that will be running after a given period.default StringenqueuePeriodic(String queueName, Object message, long period, TimeUnit unit) Enqueue a message on given queue that will be running after a given period.default StringenqueuePeriodic(String queueName, Object message, Duration period) Enqueue a message on given queue that will be running after a given period.booleanenqueuePeriodic(String queueName, String messageId, Object message, long periodInMilliSeconds) Enqueue a message on given queue that will be running after a given period.default booleanenqueuePeriodic(String queueName, String messageId, Object message, long period, TimeUnit unit) Enqueue a message on given queue that will be running after a given period.default booleanenqueuePeriodic(String queueName, String messageId, Object message, Duration period) Enqueue a message on given queue that will be running after a given period.booleanenqueueUnique(String queueName, String messageId, Object message) Enqueue unique message on a given queue without any delay, consume as soon as possible.default booleanenqueueUniqueAt(String queueName, String messageId, Object message, long timeInMilliSeconds) Schedule unique messages on the given queue at the provided time.default booleanenqueueUniqueAtWithPriority(String queueName, String priority, String messageId, Object message, long timeInMilliSeconds) Schedule unique messages on the given queue at the provided time.booleanenqueueUniqueIn(String queueName, String messageId, Object message, long delayInMillisecond) Enqueue a message on given queue with delay, consume as soon as the scheduled is expired.default booleanenqueueUniqueInWithPriority(String queueName, String priority, String messageId, Object message, long delay, TimeUnit unit) Schedule unique message on the given queue at the provided time.default booleanenqueueUniqueWithPriority(String queueName, String priority, String messageId, Object message) Enqueue unique message on given queue, that will be consumed as soon as possible.enqueueWithPriority(String queueName, String priority, Object message) Enqueue a message on given queue, that will be consumed as soon as possible.booleanenqueueWithPriority(String queueName, String priority, String messageId, Object message) Enqueue a message on given queue, that will be consumed as soon as possible.enqueueWithRetry(String queueName, Object message, int retryCount) Enqueue a message on the given queue with the given retry count.booleanenqueueWithRetry(String queueName, String messageId, Object message, int retryCount) Enqueue a message on the given queue with the given retry count.org.springframework.messaging.converter.MessageConverter
-
Method Details
-
enqueue
Enqueue a message on given queue without any delay, consume as soon as possible.- Parameters:
queueName- on which queue message has to be sendmessage- message object it could be any arbitrary object.- Returns:
- message id on successful enqueue otherwise null.
-
enqueue
Enqueue a message on given queue without any delay, consume as soon as possible.- Parameters:
queueName- on which queue message has to be sendmessageId- message idmessage- message object it could be any arbitrary object.- Returns:
- message was enqueue successfully or failed.
-
enqueueUnique
Enqueue unique message on a given queue without any delay, consume as soon as possible.- Parameters:
queueName- on which queue message has to be sendmessageId- the message id for uniquenessmessage- message object it could be any arbitrary object.- Returns:
- message id on successful enqueue otherwise null.
-
enqueueWithRetry
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 sendmessage- 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 usingRqueueListener.numRetries()- Returns:
- message id on successful enqueue otherwise null.
-
enqueueWithRetry
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 sendmessageId- 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 usingRqueueListener.numRetries()- Returns:
- message was enqueue successfully or failed.
-
enqueueWithPriority
Enqueue a message on given queue, that will be consumed as soon as possible.- Parameters:
queueName- on which queue message has to be sendpriority- the priority for this message, like high, low, medium etcmessage- message object it could be any arbitrary object.- Returns:
- message id on successful enqueue otherwise null.
-
enqueueWithPriority
Enqueue a message on given queue, that will be consumed as soon as possible.- Parameters:
queueName- on which queue message has to be sendpriority- the priority for this message, like high, low, medium etcmessageId- the message id for this messagemessage- 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 sendpriority- the priority for this message, like high, low, medium etcmessageId- the message id for this messagemessage- message object it could be any arbitrary object.- Returns:
- message was enqueue successfully or failed.
-
enqueueIn
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 sendmessage- message object it could be any arbitrary object.delayInMilliSecs- delay in milliseconds- Returns:
- message id on successful enqueue otherwise null.
-
enqueueIn
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 sendmessageId- the message id, using which this message will be identifiedmessage- message object it could be any arbitrary object.delayInMilliSecs- delay in milliseconds- Returns:
- message was enqueue successfully or failed.
-
enqueueIn
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 sendmessage- 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
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 sendmessageId- the message id, using which this message will be identifiedmessage- message object it could be any arbitrary object.delay- time to wait before it can be executed.- Returns:
- success or failure.
-
enqueueIn
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 sendmessage- 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 sendmessageId- message id using which this message can be identifiedmessage- 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 sendmessageId- the message id for uniquenessmessage- message object it could be any arbitrary object.delayInMillisecond- total execution delay- Returns:
- message id on successful enqueue otherwise null.
-
enqueueInWithRetry
Enqueue a task that would be scheduled to run in the specified milliseconds.- Parameters:
queueName- on which queue message has to be sentmessage- 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 usingRqueueListener.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 sentmessageId- the message identifiermessage- 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 usingRqueueListener.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 sendpriority- the name of the priority levelmessage- 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 sendpriority- the name of the priority levelmessageId- the message idmessage- 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 sendpriority- the name of the priority levelmessage- 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 sendpriority- the name of the priority levelmessageId- the message idmessage- 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 sendpriority- the name of the priority levelmessage- 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 sendpriority- the name of the priority levelmessageId- the message idmessage- 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 sendpriority- the name of the priority levelmessageId- the message idmessage- 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
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 sendmessage- 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 sendmessageId- message idmessage- 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
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 sendmessage- 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
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 sendmessageId- the message idmessage- 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
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 sendmessage- 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
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 sendmessageId- the message idmessage- 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 sendmessageId- a unique identifier for this messagemessage- 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 sendpriority- the name of the priority levelmessage- 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 sendpriority- the name of the priority levelmessageId- the message idmessage- 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 sendpriority- the name of the priority levelmessage- 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 sendpriority- the name of the priority levelmessageId- the message idmessage- 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
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 sendpriority- the name of the priority levelmessage- 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 sendpriority- the name of the priority levelmessageId- the message idmessage- 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 sendpriority- priority of the given messagemessageId- a unique identifier message id for this messagemessage- 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
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 sendmessage- message object it could be any arbitrary object.periodInMilliSeconds- period of this job in milliseconds.- Returns:
- message id on successful enqueue otherwise null.
-
enqueuePeriodic
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 sendmessage- message object it could be any arbitrary object.period- period of this jobunit- period unit- Returns:
- message id on successful enqueue otherwise null.
-
enqueuePeriodic
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 sendmessage- 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 sendmessageId- message id corresponding to this messagemessage- 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 sendmessageId- message id corresponding to this messagemessage- 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 sendmessageId- message id corresponding to this messagemessage- message object it could be any arbitrary object.period- period of this job .- Returns:
- success or failure
-
getMessageConverter
org.springframework.messaging.converter.MessageConverter getMessageConverter()
-