Skip to content

getSchema: multiple connections open on cache-miss #247

@pwmcintyre

Description

@pwmcintyre

i have an issue when using Schema Registry with Lambda and NodeJS.

With Lambda, your function receives a batch (up to 100) of messages.

If you attempt to decode them concurrently, each with experience a cache-miss and open a new connection to fetch the schema.

https://github.com/kafkajs/confluent-schema-registry/blob/a3921d3cbd203eb7c41a0cb321b12a2608c7ecd8/src/SchemaRegistry.ts#L242C1-L246C6

Consider using a mutex to lock each schema by ID to avoid this.

Workaround: don't use concurrency when decoding?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions