Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@kaluza/kafka-node-avro
Advanced tools
A wrapper that combine node-rdkafka
and avsc
packages together in an easy to reason about API.
npm install @kaluza/kafka-node-avro
As this ultimately uses rdkafka, a C library, your system needs to be set up to build that library.
For the library to work on mac os you will need to add 2 flags to your ~/.bash_profile
see installation instructions from node-rdkafka:
export CPPFLAGS=-I/usr/local/opt/openssl/include
export LDFLAGS=-L/usr/local/opt/openssl/lib
Make sure Python point to a version 2.. and openssl is installed correcly on the machine.
It should just work, but if not make sure the following are installed:
For Windows, run npm install -g windows-build-tools
first, then install kafka-node-avro.
If you have multiple python versions installed, you need to make sure that python
in your PATH resolves to a Python 2 version, otherwise the build of rdkafka will fail
const { consumer } = await createClients({
host: kafka.host,
schemaRegistry: kafka.schemaRegistry,
ca,
cert,
key
});
await consumer.subscribe(
['OUTPUT_TEST_TOPIC'],
{ groupId: 'kafka-node-example-consuming-group' },
(message) => {
console.log(message);
},
(err) => {
console.error(err);
}
);
// Will stop listening to topic
consumer.unsubscribe();
const { producer } = await createClients({
host: kafka.host,
schemaRegistry: kafka.schemaRegistry,
ca,
cert,
key
});
await producer.registerSchema('TEST_OUTPUT_TOPIC', [
{
default: null,
name: 'name',
type: ['null', 'string']
}
]);
const response = await producer.sendMessage({
topic: 'TEST_OUTPUT_TOPIC',
messages: {
name: 'Bender Bending Rodriguez'
}
});
console.log(response);
Install dependencies:
yarn
Run build:
yarn build
Run tests:
yarn test
Run examples:
example/certificates
with the following files ca.pem
, service.key
, service.cert
config.json
file with the following content:{
"kafka": {
"host": "HOST_NAME_HERE",
"schemaRegistry": "SCHEMA_REGISTRY_HERE",
"queues": [
{
"topic": "TOPIC_NAME",
"partition": 0,
"offset": 0
}
],
"queuesGroup": ["TOPIC_NAME"]
}
}
cd example && node produce-message-to-topic.js
for exampleFAQs
A node wrapper on top of kafka-node and avsc
The npm package @kaluza/kafka-node-avro receives a total of 1 weekly downloads. As such, @kaluza/kafka-node-avro popularity was classified as not popular.
We found that @kaluza/kafka-node-avro demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.