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

@nestjs/microservices kafkajs eachBatch support #9455

Closed
1 task done
benhason1 opened this issue Apr 9, 2022 · 1 comment
Closed
1 task done

@nestjs/microservices kafkajs eachBatch support #9455

benhason1 opened this issue Apr 9, 2022 · 1 comment
Labels
needs triage This issue has not been looked into type: enhancement 🐺

Comments

@benhason1
Copy link

benhason1 commented Apr 9, 2022

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

In today implementation of kafka microservice client there isn't any option for sending or consuming messages in batches.

Describe the solution you'd like

I would like an option to define the type of messages I receive or send either: one by one or batches.

This features ( consume, produce ) are already supported in kafkajs and it would be great if the nestjs library will reveal this in his implementation.

Teachability, documentation, adoption, migration strategy

consumer

 const app = await NestFactory.createMicroservice<MicroserviceOptions>(
    AppModule,
    {
      transport: Transport.KAFKA,
      options: {
        consumer: {
         messageType: 'message' | 'batch',
          groupId: 'temp',
        },
      },
    },
  );

producer

this.client.send('pattern', { messages: [] } | new DemoRequest() )

What is the motivation / use case for changing the behavior?

process messages by batches for improving performance.

@benhason1 benhason1 added needs triage This issue has not been looked into type: enhancement 🐺 labels Apr 9, 2022
@kamilmysliwiec
Copy link
Member

Thanks for your suggestion!

This has been discussed in the past (see older Kafka-related issues) and we decided to not implement it in the foreseeable future.

If you think your request could live outside Nest's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

@nestjs nestjs locked and limited conversation to collaborators Apr 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs triage This issue has not been looked into type: enhancement 🐺
Projects
None yet
Development

No branches or pull requests

2 participants