1.1.0 • Published 11 months ago

@goopen/nestjs-schema-registry v1.1.0

Weekly downloads
-
License
BSD
Repository
github
Last release
11 months ago

Tiny NestJS module to use with Confluent Schema Registry

1. Install

npm install @goopen/nestjs-schema-registry @kafkajs/confluent-schema-registry

2. Register the Confluent schema module in your app

@Module({
  imports: [
    SchemaRegistryModule.register({
      isGlobal: true,
      host: SCHEMA_REGISTRY_URL,
      auth: {
        username: SCHEMA_REGISTRY_USERNAME,
        password: SCHEMA_REGISTRY_PASSWORD,
      },
    }),
  ],
})
export class KafkaModule {}

3. You're then able to use the injector to use the schema registry

@Injectable()
export class KafkaService{
  constructor(
    @InjectSchemaRegistry() private readonly schemaRegistry: SchemaRegistry,
  ) {}
}
1.1.0

11 months ago

1.0.0

1 year ago