Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dyno Queue pop doesnt work as expected #58

Open
Ashwinikmurthy opened this issue Sep 17, 2019 · 0 comments
Open

Dyno Queue pop doesnt work as expected #58

Ashwinikmurthy opened this issue Sep 17, 2019 · 0 comments

Comments

@Ashwinikmurthy
Copy link

If the thread to consume the messages is started first and then we push the messages queue, the push works fine but , pop doesn't happen at all. The timeout in pop is set 1 day.
here is the sample code we are using:
Thread 1 - pop
ExecutorService executorService = Executors.newSingleThreadExecutor();
Runnable runnable = ()->{
while(true) {
V1Queue.pop(1,1,TimeUnit.DAYS).forEach(DynoQueueMain::processMessage);
}
};
Runnable runnable1 =()->{
for(int i=0;i<5;i++) {
Message m = new Message("id-"+i, "payload-extra-"+i);
messages.add(m);
V1Queue.push(messages);

        }
    };
    executorService1.submit(runnable1);

version of dynomite 0.5.7

After the restarting the application , the pop is done.
The code gets stuck in
while(this.prefetchedIds.size() < messageCount && this.clock.millis() - start < waitFor) {
Uninterruptibles.sleepUninterruptibly(200L, TimeUnit.MILLISECONDS);
this.prefetchIds();
}
though the messages are pushed after the thread is started.
Steps:
start the consumer thread
set the timeout 1 day
later start pushing the messages
the message gets pushed.
pop doesnt happen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant