Skip to content

Failed to parse server response #2

@akoenig

Description

@akoenig

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 🙁

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions