Skip to content

Single consumer for ordered queue in distributed system #189

Closed Answered by taalexlistex
taalexlistex asked this question in Q&A
Discussion options

You must be logged in to vote

at the moment implemented by overriding pop method in RqueueMessageTemplate

@Bean
    public RqueueMessageTemplate rqueueMessageTemplate(RqueueConfig config, Lock lock) {
        return new RqueueMessageTemplateImpl(config.getConnectionFactory(), config.getReactiveRedisConnectionFactory()) {
            @Override
            public List<RqueueMessage> pop(String queueName, String processingQueueName, String processingChannelName, long visibilityTimeout, int count) {
                String token = null;
                if (queueName.contains(BILLING_QUEUE)) {
                    token = lock.acquire(List.of(queueName), DISTRIBUTED_QUEUE_LOCK, 60000);
                    if (token == null) …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by taalexlistex
Comment options

You must be logged in to vote
4 replies
@sonus21
Comment options

@taalexlistex
Comment options

@sonus21
Comment options

@taalexlistex
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants