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

Gracefully terminating client message consumer #13

Open
aleksarias opened this issue Feb 19, 2020 · 2 comments
Open

Gracefully terminating client message consumer #13

aleksarias opened this issue Feb 19, 2020 · 2 comments

Comments

@aleksarias
Copy link

aleksarias commented Feb 19, 2020

I've noticed when I KeyboardInterrupt I can't get the client to gracefully exit when using this setup:

await client.open()

# subscribe to topics
await client.subscribe("/topic/my-topic")

# listen for incoming messages
async for message in client:
    # code to execute on receiving message
    ...

Is there anyway to cancel the client but allow it to continue processing the messages it has pref-etched?

@whitespaceninja
Copy link

Is there a reason you can't resume where you left off next time using replay storage? There could be a bunch of messages queued up, and an arbitrary amount of time to process each one that depends on your program execution. Adding all that time up means you are delaying a system call to shut down for an undetermined amount of time.

@welcomemat-services
Copy link

@whitespaceninja,

I am having issues with reply storage with pulling the replay id and using it in the subsequent invocations.

Can you please take a look at this issue and see what I am doing wrong there? Thanks for any help on this.

#19 (comment)

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

3 participants