File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -406,14 +406,14 @@ async handleUserCreated(@Payload() data: IncomingMessage) {
406406 await this .client .commitOffsets ([ { topic: data .topic , partition: data .partition , offset: data .offset } ])
407407}
408408@@switch
409-
410- constructor (@Inject (KAFKA ) client : ClientKafka ) {}
411-
412- @EventPattern (' user_created' )
413- async handleUserCreated (data ) {
409+ @Bind (Payload (), Ctx ())
410+ @EventPattern (' user.created' )
411+ async handleUserCreated (data , context ) {
414412 // business logic
415413
416- await this .client .commitOffsets ([ { topic: data .topic , partition: data .partition , offset: data .offset } ])
414+ const originalMessage = context .getMessage ();
415+ const { topic, partition, offset } = originalMessage ;
416+ await this .client .commitOffsets ([{ topic , partition , offset }])
417417}
418418```
419419
You can’t perform that action at this time.
0 commit comments