Skip to content

fix consumer destroy #141

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion memphis/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def __init__(
self.context = {}
self.dls_messages = []
self.dls_current_index = 0
self.t_consume = None
self.dls_callback_func = None
self.t_dls = asyncio.create_task(self.__consume_dls())

Expand Down Expand Up @@ -191,4 +192,4 @@ async def destroy(self):
map_key = internal_station_name + "_" + self.consumer_name.lower()
del self.connection.consumers_map[map_key]
except Exception as e:
raise MemphisError(str(e)) from e
raise MemphisError(str(e)) from e
1 change: 1 addition & 0 deletions memphis/memphis.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ async def consumer(
real_name = consumer_name.lower()
if generate_random_suffix:
consumer_name = self.__generateRandomSuffix(consumer_name)
real_name += "_" + consumer_name.split("_")[-1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is wrong since real name is the consumer name without the suffix which is the desired behavior

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, but it breaks consumer shutdown, I'll find another way to fix it soon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks, waiting for that

cg = consumer_name if not consumer_group else consumer_group

if start_consume_from_sequence <= 0:
Expand Down