Graphql-engine: Kafka support

Created on 4 Dec 2019  路  7Comments  路  Source: hasura/graphql-engine

Hi all,
Like RIG (https://accenture.github.io/reactive-interaction-gateway/docs/intro.html) does, I think that will be great to have Kafka support on Hasura which will be really handy to manage more cases.

server ideas

Most helpful comment

A related request:

I was looking at the stuff about Actions and had a thought... I'd love to see pub/sub actions. Save the event to the event store then publish it to a topic and after it's accepted update the event in the store so it's marked as sent.

I'd also love to be able to hook events to a subscription so it would pull from the topic, save to the event store, and update the topic that the event has been read (updating offset for Kafka). Then the event can be processed locally with an event handler.

All 7 comments

@Rajivhost Could you tell more about the use case?

Hi,
The idea here is to be able to stream messages from a Kafka topic and have them as subscriptions for example on Hasura. I want to use Hasura as a API Gateway and manage a unique GQL schema which will be able to include events coming from Kafka.

image

A microservice can publish events to a Kafka topic, Hasura can connect to this topic and present those streaming events as subscritions for example

@Rajivhost Thanks for your clarification.
It's interesting feature.

A related request:

I was looking at the stuff about Actions and had a thought... I'd love to see pub/sub actions. Save the event to the event store then publish it to a topic and after it's accepted update the event in the store so it's marked as sent.

I'd also love to be able to hook events to a subscription so it would pull from the topic, save to the event store, and update the topic that the event has been read (updating offset for Kafka). Then the event can be processed locally with an event handler.

I am looking at using hasura with Kafka as well. It seems like this could be accomplished with what is available:

Use Event Triggers to call a service that publishes events to Kafka for getting events from hasura into

Use an integration table to get Kafka updates to hasura subscriptions

  1. Create a table in hasura with only an ID, and timestamp for your external events that come from Kafka
  2. Create a remote schema that calls your MS that uses the id from your table in hasura to fetch the entire event contents
  3. When you process data from Kafka update the timestamp on the ID in hasura
  4. Create a graphql subscription on the integration table and remote schema in hasura.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

bogdansoare picture bogdansoare  路  3Comments

tirumaraiselvan picture tirumaraiselvan  路  3Comments

marionschleifer picture marionschleifer  路  3Comments

stereobooster picture stereobooster  路  3Comments

rikinsk-zz picture rikinsk-zz  路  3Comments