Class RqueueMessageEnqueuerImpl

    • Field Detail

      • messageHeaders

        protected final org.springframework.messaging.MessageHeaders messageHeaders
      • messageConverter

        protected org.springframework.messaging.converter.MessageConverter messageConverter
      • rqueueConfig

        @Autowired
        protected RqueueConfig rqueueConfig
    • Constructor Detail

      • RqueueMessageEnqueuerImpl

        public RqueueMessageEnqueuerImpl​(RqueueMessageTemplate messageTemplate,
                                         org.springframework.messaging.converter.MessageConverter messageConverter,
                                         org.springframework.messaging.MessageHeaders messageHeaders)
    • Method Detail

      • enqueue

        public java.lang.String enqueue​(java.lang.String queueName,
                                        java.lang.Object message)
        Description copied from interface: RqueueMessageEnqueuer
        Enqueue a message on given queue without any delay, consume as soon as possible.
        Specified by:
        enqueue in interface RqueueMessageEnqueuer
        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

        public boolean enqueue​(java.lang.String queueName,
                               java.lang.String messageId,
                               java.lang.Object message)
        Description copied from interface: RqueueMessageEnqueuer
        Enqueue a message on given queue without any delay, consume as soon as possible.
        Specified by:
        enqueue in interface RqueueMessageEnqueuer
        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

        public boolean enqueueUnique​(java.lang.String queueName,
                                     java.lang.String messageId,
                                     java.lang.Object message)
        Description copied from interface: RqueueMessageEnqueuer
        Enqueue unique message on a given queue without any delay, consume as soon as possible.
        Specified by:
        enqueueUnique in interface RqueueMessageEnqueuer
        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

        public java.lang.String enqueueWithRetry​(java.lang.String queueName,
                                                 java.lang.Object message,
                                                 int retryCount)
        Description copied from interface: RqueueMessageEnqueuer
        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.
        Specified by:
        enqueueWithRetry in interface RqueueMessageEnqueuer
        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

        public boolean enqueueWithRetry​(java.lang.String queueName,
                                        java.lang.String messageId,
                                        java.lang.Object message,
                                        int retryCount)
        Description copied from interface: RqueueMessageEnqueuer
        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.
        Specified by:
        enqueueWithRetry in interface RqueueMessageEnqueuer
        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

        public java.lang.String enqueueWithPriority​(java.lang.String queueName,
                                                    java.lang.String priority,
                                                    java.lang.Object message)
        Description copied from interface: RqueueMessageEnqueuer
        Enqueue a message on given queue, that will be consumed as soon as possible.
        Specified by:
        enqueueWithPriority in interface RqueueMessageEnqueuer
        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

        public boolean enqueueWithPriority​(java.lang.String queueName,
                                           java.lang.String priority,
                                           java.lang.String messageId,
                                           java.lang.Object message)
        Description copied from interface: RqueueMessageEnqueuer
        Enqueue a message on given queue, that will be consumed as soon as possible.
        Specified by:
        enqueueWithPriority in interface RqueueMessageEnqueuer
        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.
      • enqueueIn

        public java.lang.String enqueueIn​(java.lang.String queueName,
                                          java.lang.Object message,
                                          long delayInMilliSecs)
        Description copied from interface: RqueueMessageEnqueuer
        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
        Specified by:
        enqueueIn in interface RqueueMessageEnqueuer
        Parameters:
        queueName - on which queue message has to be send
        message - message object it could be any arbitrary object.
        delayInMilliSecs - delay in milli seconds
        Returns:
        message id on successful enqueue otherwise null.
      • enqueueIn

        public boolean enqueueIn​(java.lang.String queueName,
                                 java.lang.String messageId,
                                 java.lang.Object message,
                                 long delayInMilliSecs)
        Description copied from interface: RqueueMessageEnqueuer
        Schedule a message on the given queue with the provided delay. It will be available to consume as soon as the delay elapse.
        Specified by:
        enqueueIn in interface RqueueMessageEnqueuer
        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 milli seconds
        Returns:
        message was enqueue successfully or failed.
      • enqueueUniqueIn

        public boolean enqueueUniqueIn​(java.lang.String queueName,
                                       java.lang.String messageId,
                                       java.lang.Object message,
                                       long delayInMillisecond)
        Description copied from interface: RqueueMessageEnqueuer
        Enqueue a message on given queue with delay, consume as soon as the delayed is expired.
        Specified by:
        enqueueUniqueIn in interface RqueueMessageEnqueuer
        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

        public java.lang.String enqueueInWithRetry​(java.lang.String queueName,
                                                   java.lang.Object message,
                                                   int retryCount,
                                                   long delayInMilliSecs)
        Description copied from interface: RqueueMessageEnqueuer
        Enqueue a task that would be scheduled to run in the specified milli seconds.
        Specified by:
        enqueueInWithRetry in interface RqueueMessageEnqueuer
        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 sent to dead letter queue configured using RqueueListener.numRetries() ()}
        delayInMilliSecs - delay in milli seconds, this message would be only visible to the listener when number of millisecond has elapsed.
        Returns:
        message id on successful enqueue otherwise null
      • enqueueInWithRetry

        public boolean enqueueInWithRetry​(java.lang.String queueName,
                                          java.lang.String messageId,
                                          java.lang.Object message,
                                          int retryCount,
                                          long delayInMilliSecs)
        Description copied from interface: RqueueMessageEnqueuer
        Enqueue a task that would be scheduled to run in the specified milli seconds.
        Specified by:
        enqueueInWithRetry in interface RqueueMessageEnqueuer
        Parameters:
        queueName - on which queue message has to be send
        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 milli seconds, this message would be only visible to the listener when number of millisecond has elapsed.
        Returns:
        message was enqueue successfully or failed.
      • enqueuePeriodic

        public java.lang.String enqueuePeriodic​(java.lang.String queueName,
                                                java.lang.Object message,
                                                long period)
        Description copied from interface: RqueueMessageEnqueuer
        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.
        Specified by:
        enqueuePeriodic in interface RqueueMessageEnqueuer
        Parameters:
        queueName - on which queue message has to be send
        message - message object it could be any arbitrary object.
        period - period of this job in milliseconds.
        Returns:
        message id on successful enqueue otherwise null.
      • enqueuePeriodic

        public boolean enqueuePeriodic​(java.lang.String queueName,
                                       java.lang.String messageId,
                                       java.lang.Object message,
                                       long period)
        Description copied from interface: RqueueMessageEnqueuer
        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.
        Specified by:
        enqueuePeriodic in interface RqueueMessageEnqueuer
        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 in milliseconds.
        Returns:
        success or failure
      • storeMessageMetadata

        protected void storeMessageMetadata​(RqueueMessage rqueueMessage,
                                            java.lang.Long delayInMillis)
      • enqueue

        protected void enqueue​(QueueDetail queueDetail,
                               RqueueMessage rqueueMessage,
                               java.lang.Long delayInMilliSecs)
      • pushMessage

        protected java.lang.String pushMessage​(java.lang.String queueName,
                                               java.lang.String messageId,
                                               java.lang.Object message,
                                               java.lang.Integer retryCount,
                                               java.lang.Long delayInMilliSecs)
      • pushPeriodicMessage

        protected java.lang.String pushPeriodicMessage​(java.lang.String queueName,
                                                       java.lang.String messageId,
                                                       java.lang.Object message,
                                                       long periodInMilliSeconds)
      • deleteAllMessages

        protected java.lang.Object deleteAllMessages​(QueueDetail queueDetail)
      • registerQueueInternal

        protected void registerQueueInternal​(java.lang.String queueName,
                                             java.lang.String... priorities)