Giter Club home page Giter Club logo

simple_eventconsumer's Introduction

Simple Eventconsumer

This is the simplest python event consumer using eventstore I could think of.

Requirements:

  • docker-compose (and docker of course)

How to Run?

  • In a terminal run docker-compose up
  • Once it's running, in another terminal, run:
python send_test_event.py "Gil"

You should see in the docker-compose logs the following:

eventconsumer_1  | WARNING:root:Hi Gil

simple_eventconsumer's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar lurst avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

simple_eventconsumer's Issues

Client needs to see at least one event when it starts up

If you see this message:

eventconsumer_1  | Traceback (most recent call last):
eventconsumer_1  |   File "/usr/lib/python3.6/site-packages/atomicpuppy/atomicpuppy.py", line 453, in fetch
eventconsumer_1  |     async with self.session.get(uri, params=params, headers=headers) as response:
eventconsumer_1  |   File "/usr/lib/python3.6/site-packages/aiohttp/client.py", line 783, in __aenter__
eventconsumer_1  |     self._resp = await self._coro
eventconsumer_1  |   File "/usr/lib/python3.6/site-packages/aiohttp/client.py", line 412, in _request
eventconsumer_1  |     resp.raise_for_status()
eventconsumer_1  |   File "/usr/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 789, in raise_for_status
eventconsumer_1  |     headers=self.headers)
eventconsumer_1  | aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found'
eventconsumer_1  | Received bad http response with status 404 from http://eventstore:2113/streams/hello/0/forward/20
eventconsumer_1  | Traceback (most recent call last):
eventconsumer_1  |   File "/usr/lib/python3.6/site-packages/atomicpuppy/atomicpuppy.py", line 453, in fetch
eventconsumer_1  |     async with self.session.get(uri, params=params, headers=headers) as response:
eventconsumer_1  |   File "/usr/lib/python3.6/site-packages/aiohttp/client.py", line 783, in __aenter__
eventconsumer_1  |     self._resp = await self._coro
eventconsumer_1  |   File "/usr/lib/python3.6/site-packages/aiohttp/client.py", line 412, in _request
eventconsumer_1  |     resp.raise_for_status()
eventconsumer_1  |   File "/usr/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 789, in raise_for_status
eventconsumer_1  |     headers=self.headers)
eventconsumer_1  | aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found'
eventconsumer_1  |
eventconsumer_1  | During handling of the above exception, another exception occurred:

That's because atomicpuppy needs to read one event from the stream, so one way to fix this at this moment is to:

  • Leave the docker container for eventstore running docker-compose up.
  • Run python send_test_event.py HI
  • Turn off the docker containers docker-compose down
  • Restart everything docker-compose up

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.