Giter VIP home page Giter VIP logo

geo-stream-kafka's Introduction

geo-stream-kafka

setup geostream fastapi aiokafka

geostream gif

see blogpost for a more detailed description

docker-compose up -d

If you're on MacOS set an environment variable like:

export DOCKER_KAFKA_HOST=$(ipconfig getifaddr en0)

that is afterwards used in docker-compose.yml to identify the KAFKA_ADVERTISED_HOST_NAME. Some similar workaround has to exist for Windows users. For linux I assume you can just set it to localhost if you're only running on Kafka node. See github.com/wurstmeister/kafka-docker/wiki/Connectivity.

Kafka

Kafka will be served on localhost:9092

Frontend

open /geostream/frontend/app/index.html and associated map.js will consume messages when they come in

Producer

can produce messages to a topic at localhost:8002/producer/<topicname>

Consumer

can consume kafka messages through at localhost:8003/consumer/<topicname>

geo-stream-kafka's People

Contributors

iwpnd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

geo-stream-kafka's Issues

Missing .env

Great job on the article and the project here ๐Ÿš€

I see that here is missing .env_example or .env specifically. I think it supposed to be on /geostream directory.

Best,

Missing .env and error in geo-stream-kafka_producer docker

Thanks for putting together this example. I encountered an issue when building the app . The env_file is not available in the geostream folder which caused the docker compose to fail. So I removed it.

env_file:
- ./geostream/.env

When checking geo-stream-kafka_producer docker I saw the following error . Hope you can help .

File "./app/main.py", line 5, in <module>
    from app.core.config import KAFKA_INSTANCE
  File "./app/core/config.py", line 12, in <module>
    KAFKA_URI: str = config("KAFKA_URI")
  File "/usr/local/lib/python3.7/site-packages/starlette/config.py", line 62, in __call__
    return self.get(key, cast, default)
  File "/usr/local/lib/python3.7/site-packages/starlette/config.py", line 75, in get
    raise KeyError(f"Config '{key}' is missing, and has no default.")
KeyError: "Config 'KAFKA_URI' is missing, and has no default."

Unable to bootstrap from [('localhost', 9092, <AddressFamily.AF_UNSPEC: 0>)] connect kafka broker error

After running the services through docker ubuntu, I configured the variables for kafka as you wrote localhost:9092.
My kafka is accessible from the client, I can connect to it via the client gui. But the service doesn't connect to it, I always get the same error.
kafka.errors.KafkaConnectionError: KafkaConnectionError: Unable to bootstrap from [('localhost', 9092, <AddressFamily.AF_UNSPEC: 0>)]

Please help, what could be the problem, have you encountered it?

producer_1 | File "/usr/local/lib/python3.7/site-packages/starlette/routing.py", line 566, in aenter
producer_1 | await self._router.startup()
producer_1 | file "/usr/local/lib/python3.7/site-packages/starlette/routing.py", line 648, in startup
producer_1 | await handler()
producer_1 | file "./app/main.py", line 22, in startup_event
producer_1 | await aioproducer.start()
producer_1 | file "/usr/local/lib/python3.7/site-packages/aiokafka/producer/producer.py", line 307, in start
producer_1 | await self.client.bootstrap()
producer_1 | file "/usr/local/lib/python3.7/site-packages/aiokafka/client.py", line 252, in bootstrap
producer_1 | f'Unable to bootstrap from {self.hosts}')
producer_1 | kafka.errors.KafkaConnectionError: KafkaConnectionError: Unable to bootstrap from [('localhost', 9092, <AddressFamily.AF_UNSPEC: 0>)]

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.