YACS-RCOS / yacs-notifications

Yacs event stream Websocket API
MIT License
0 stars 2 forks source link

Create kafka consumers #5

Open Bad-Science opened 6 years ago

Bad-Science commented 6 years ago

As a first step in the development of this service, we should create simple kafka consumer using karafka. See https://github.com/karafka/karafka/wiki/Consuming-messages for details.

This consumer should simply consume messages from the course_changed topic, and print them to stdout.

In order to get started, karafka should first be added to the Gemfile

huangmj7 commented 6 years ago

Hi. I had install the kafraka into Gemfile in yacs-notification but when I tried to ran bin/yacs-start-development it returned error like this:

ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.7/main: temporary error (try again later) WARNING: Ignoring APKINDEX.70c88391.tar.gz: No such file or directory ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.7/community: temporary error (try again later) WARNING: Ignoring APKINDEX.5022a8a2.tar.gz: No such file or directory ERROR: unsatisfiable constraints: build-base (missing): required by: world[build-base] ruby-dev (missing): required by: world[ruby-dev] ERROR: Service 'notifications' failed to build: The command '/bin/sh -c apk add --update ruby-dev build-base' returned a non-zero code: 2

Should I tried to install the gem after start developing and what can I do for this?

Thanks a lot.

huangmj7 commented 6 years ago

Update: I tried to pull/check out a older version and got in infinite loop things and then fetch back to origin, which still have the same error.

Bad-Science commented 6 years ago

@huangmj7 Thanks for the update! Could you open a PR, and label it as WIP? Then I can take a look and try to see what the problem is.

huangmj7 commented 6 years ago

I tried, but it seemed I can't fork a branch and pull requests:. "Permission to YACS-RCOS/yacs-orchestra.git denied to huangmj7."

huangmj7 commented 6 years ago

Potential bugs: docker-compose time out when ran notifications. Possible cause: If directly run "exec karafka server" in ruby 2.5.1 version, it will show that the CLI only work for ruby version 2.4.2.

`mjhyacs@mjhyacs-VirtualBox:~/yacs-orchestra/develop/yacs-notifications$ bundle exec karafka help Your Ruby version is 2.4.2, but your Gemfile specified 2.5.1 mjhyacs@mjhyacs-VirtualBox:~/yacs-orchestra/develop/yacs-notifications$ rbenv local 2.5.1 mjhyacs@mjhyacs-VirtualBox:~/yacs-orchestra/develop/yacs-notifications$ bundle exec karafka help rbenv: karafka: command not found

The karafka' command exists in these Ruby versions: 2.4.2