paambaati / node-liftbridge Goto Github PK
View Code? Open in Web Editor NEW๐ Node.js client for Liftbridge
Home Page: https://paambaati.github.io/node-liftbridge/globals.html
License: MIT License
๐ Node.js client for Liftbridge
Home Page: https://paambaati.github.io/node-liftbridge/globals.html
License: MIT License
Thanks for compiling this library ๐ ๐ I just tried to build a little prototype in order to get a feeling of how everything is like in Node.js land.
Started liftbridge as described in the quick start:
docker run -d --name=liftbridge-main -p 4222:4222 -p 9292:9292 -p 8222:8222 -p 6222:6222 liftbridge/liftbridge-docker
Created a stream, published a message and read via a subscription:
import LiftbridgeClient, { Message } from "liftbridge";
import LiftbridgeMessage from "liftbridge/lib/message";
import LiftbridgeStream from "liftbridge/lib/stream";
const app = async () => {
const client = new LiftbridgeClient("localhost:9292");
await client.connect();
const name = `my-stream-v${Date.now()}`;
const subject = `my-subject-v${Date.now()}`;
const streamDef = new LiftbridgeStream({
name,
subject,
partitions: 1,
maxReplication: true
});
await client.createStream(streamDef);
await client.publish(
new LiftbridgeMessage({
subject,
key: Date.now().toString(),
value: JSON.stringify({
foo: "bar"
})
})
);
const subscription = client.subscribe(
new LiftbridgeStream({
subject,
name
})
);
subscription.on("data", (data: Message) => {
console.log("message");
console.log(data);
});
};
app().catch(err => {
process.exitCode = 1;
console.error(err);
});
Creating the stream and publishing the message seems to work. Consuming the stream fails with a:
Error: 13 INTERNAL: Failed to parse server response
I also tried to generate a new gRPC binding, but this leads to the same result above ๐
Looks like you have not added the module into dependencies block. It's from liftbridge/grpc/generated/api_pb.js
PR #5
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.