Skip to content

Commit

Permalink
fix: KafkaProducerFactory not init from decorator (#4271)
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 authored Jan 25, 2025
1 parent 32458b2 commit 606d76d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/kafka/src/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Configuration } from '@midwayjs/core';
import { Configuration, IMidwayContainer } from '@midwayjs/core';
import { KafkaProducerFactory } from './service';

@Configuration({
namespace: 'kafka',
Expand All @@ -19,4 +20,8 @@ import { Configuration } from '@midwayjs/core';
},
],
})
export class KafkaConfiguration {}
export class KafkaConfiguration {
async onReady(container: IMidwayContainer) {
await container.getAsync(KafkaProducerFactory);
}
}

0 comments on commit 606d76d

Please sign in to comment.