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

Make Kafka macroable #221

Merged
merged 1 commit into from
Sep 23, 2023
Merged

Conversation

lentex
Copy link
Contributor

@lentex lentex commented Sep 22, 2023

In order to make use of macros the Illuminate Macroable trait has been added to Junges\Kafka\Kafka.

An example could look like this:

$sasl = new Sasl(username: 'username', password: 'password', mechanisms: 'mechanisms');

Kafka::macro('defaultProducer', function (string $topic) use ($sasl) {
    return $this->publishOn($topic)->withSasl($sasl);
});

$producer = Kafka::defaultProducer('test-topic');

In order to make use of macros the Illuminate Macroable trait has been
added to Junges\Kafka\Kafka.
@mateusjunges mateusjunges merged commit 445aa85 into mateusjunges:v1.13.x Sep 23, 2023
1 check passed
@mateusjunges
Copy link
Owner

Thank you! I'll write basic docs for this tomorrow and then tag a new release.

@lentex
Copy link
Contributor Author

lentex commented Sep 23, 2023

Awesome. Thank you very much for the quick reply+merge 🙂

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

Successfully merging this pull request may close these issues.

2 participants