Giter Club home page Giter Club logo

rabbitmq-producer-consumer-fastapi's Introduction

ConsumerExample-service

This project was created with Python and FastAPI framework.

Environment

Please set up your Python version to 3.10

  • python3 --version

Create your .env file.

  • cd <project-directory>
    $ touch .env
APP_NAME=Example
APP_VERSION=1.0.1
ENV=local
APP_PORT=3002
APP_HOST=localhost
BODY_LIMIT=12000
LOG_LEVEL=info
SWAGGER_ENABLED=true
DEBUG=true
MICROSERVICE_CLIENT_TIMEOUT=60
RABBITMQ_HOST=localhost
RABBITMQ_PORT=5672
RABBITMQ_USERNAME=guest
RABBITMQ_PASSWORD=guest
RABBITMQ_EXCHANGE_NAME=message_exchange
RABBITMQ_EXCHANGE_TYPE=fanout
RABBITMQ_QUEUE=message_queue
RABBITMQ_ROUTING_KEY=0
RABBITMQ_CONNECTION_ATTEMPTS=0
RABBITMQ_RETRY_DELAY=0

Setting Development Environment

  • Install virtual environment
    $ pip install virtualenv
  • Created virtual environment
    $ virtualenv env
  • Activate the virtual environment
    $ source env/bin/activate
  • Install libraries
    $ pip install -r requirements.txt

Run Service

    $ python3 main.py

Swagger Documents

Producer Exec

  • Setup RabbitMQ
    $ brew update
    $ brew install rabbitmq
    $ brew info rabbitmq
  • Configration RabbitMQ

CONF_ENV_FILE="/opt/homebrew/etc/rabbitmq/rabbitmq-env.conf" /opt/homebrew/opt/rabbitmq/sbin/rabbitmq-server

  • RabbitMQ service start & stop
    $ brew services start rabbitmq

&&

    $ brew services stop rabbitmq

Run Producer

Don't forget to enable virtual environment

    $ cd producer
    $ python3 app.py

rabbitmq-producer-consumer-fastapi's People

Contributors

seymasa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

jaygith

rabbitmq-producer-consumer-fastapi's Issues

rabbitmq asynchronous

service needs to be run and become able to listen to rabbitmq asynchronous.
"Waiting for application startup" when adding long-running loop in startup event.

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.