Giter VIP home page Giter VIP logo

Comments (8)

ancashoria avatar ancashoria commented on May 13, 2024

@jdmorlan thanks, I really appreciate it.

This package has two concepts for communication.

  1. Kafka topic - There's a single kafka topic right now over which all the messages are sent. eg: eog_ioptimize_prod_timeseries
  2. Pubsub channel - Even though all the messages are sent over kafka topic, this is useful if you want to subscribe to different things like: pubsub.asyncIterator('user_updates') or pubsub.asyncIterator('comments').

I see you have pubsub.asyncIterator('eog_ioptimize_prod_timeseries') which makes me believe you might be confusing kafka topic with pubsub channel.

Now, for the odd part, to actually publish something on the pubsub channel, need something like:

pubsub.publish({
  channel: 'user_updates',
  ...payloadThatYouWantToSend
})

I know it's weird to mix the channel with the actual message payload and I will fix it soon.

Let me know if this fixes your issue.

from graphql-kafka-subscriptions.

ancashoria avatar ancashoria commented on May 13, 2024

I'll work on getting the example implementation in place tomorrow.

from graphql-kafka-subscriptions.

jdmorlan avatar jdmorlan commented on May 13, 2024

I'm still a little hazy...gonna have to buy you a beer or coffee! Here is a little overview of our situation, maybe it will help in being able to say our use case is a good fit or not.

We have a service that is collecting data from a bunch of sources and producing messages that go into Kafka. I noticed that the publish method instructs the producer to write a message to Kafka, but in our situation, we only need to read as new messages come into Kafka.

The GraphQL service has no say in producing data...only acts as a reader. Is it a requirement that we publish (write to Kafka) to enable getting messages back from Kafka?

from graphql-kafka-subscriptions.

ancashoria avatar ancashoria commented on May 13, 2024

Understood,
you just want to subscribe to all the messages coming over the kafka topic.
I think I need to make a few tweaks to support this use case.

I'll get back to you with something asap.

from graphql-kafka-subscriptions.

ancashoria avatar ancashoria commented on May 13, 2024

@jdmorlan I have released version 0.2.1
Now it should also work by subscribing over the whole topic (like you do now) or by using channels like I mentioned above.
Make sure you update your dependency and let me know if it's good for you.

Thanks

from graphql-kafka-subscriptions.

jdmorlan avatar jdmorlan commented on May 13, 2024

That did the trick...thanks so much for your quick responses and help.

from graphql-kafka-subscriptions.

ancashoria avatar ancashoria commented on May 13, 2024

Awesome.
Closing the issue.

from graphql-kafka-subscriptions.

fmannhardt avatar fmannhardt commented on May 13, 2024

Has the problem with not supporting the correct publish interface of PubSubEngine ever be resolved? PubSubEngine defines it as:
abstract publish(triggerName: string, payload: any): Promise<void>;
but this implementation overloads it to:
abstract publish(payload: any): Promise<void>;

So it does not implement the interface properly and cannot be used as drop-in replacement without changing all the code.

from graphql-kafka-subscriptions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.