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

Restore the ability to use implicit subject in consumer specs #110

Open
NotGrm opened this issue Oct 26, 2022 · 1 comment
Open

Restore the ability to use implicit subject in consumer specs #110

NotGrm opened this issue Oct 26, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@NotGrm
Copy link

NotGrm commented Oct 26, 2022

Follow-up of #106

To avoid situations when calling subject was having side effects it has been decided that the gem will use an explicit consumer reference to keep track of messages sent to Kafka.

This has the downside to require developers to declare a consumer object (or a named subject) in their tests instead of relying on implicit subjects.

In the issue comment thread, I thought about looking at the described_class and testing if it inherits from Karafka::BaseConsumer. If that is the case the gem's helper could try to look at the consumer referenced object or call the subject reference.

If the described_class is not a Karafka::BaseConsumer the helper will only look for the consumer object

@mensfeld mensfeld added the enhancement New feature or request label Nov 3, 2022
@mensfeld mensfeld self-assigned this Nov 3, 2022
@mensfeld
Copy link
Member

@NotGrm can you submit a POC for this as a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants