README
Kafka Typings
This package exports typings for Kafka topics and messages so we can keep a pattern of the data exchanged between the micro-services.
Usage example
import { TOPICS, SignatureCreatedMessage } from '@rocketseat/kafka-typings/types/pluto';
import { kafka } from 'example-kafka-client-path';
const message: SignatureCreatedMessage = {
// this will be typed
}
kafka.emit(TOPICS.SIGNATURE_CREATED, message);
Using locally
With NPM
Clone this repository, install its dependencies and link the package:
gh repo clone rocketseat/kafka-typings
cd kafka-typings
npm i
npm link
The
npm link
command might required sudo if you messed up your dev environment like me.
After this, inside the other repository where you want to use the package:
npm link @rocketseat/kafka-typings
After using it local, you can unlink it with npm unlink --no-save @rocketseat/kafka-typings
.
With Yarn
Clone this repository, install its dependencies and link the package:
gh repo clone rocketseat/kafka-typings
cd kafka-typings
yarn
yarn link
After this, inside the other repository where you want to use the package:
yarn link @rocketseat/kafka-typings
After using it local, you can unlink it with yarn unlink @rocketseat/kafka-typings
.