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

getSchema: multiple connections open on cache-miss #247

Open
pwmcintyre opened this issue Jul 26, 2023 · 1 comment
Open

getSchema: multiple connections open on cache-miss #247

pwmcintyre opened this issue Jul 26, 2023 · 1 comment

Comments

@pwmcintyre
Copy link

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?

@pwmcintyre
Copy link
Author

is this repo maintained? I could supply a PR, but it doesn't look like PR's are being reviewed 😱

also appears to be using NodeJS 12.x (deprecated) and uses a docker compose spec which appears invalid?

$ npx yarn test
...
🌈 Dockest 🌈 [Exit Handler] Invalid schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant