{"id":18697527,"url":"https://github.com/adrianosferreira/microservice-messaging","last_synced_at":"2025-08-31T08:32:08.101Z","repository":{"id":94272497,"uuid":"238778757","full_name":"adrianosferreira/microservice-messaging","owner":"adrianosferreira","description":"A basic example of a messaging system for microservices architecture using Symfony, Redis, and Docker","archived":false,"fork":false,"pushed_at":"2020-09-03T10:46:11.000Z","size":1119,"stargazers_count":5,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-07T11:29:02.351Z","etag":null,"topics":["daemon","docker","message-broker","microservice-architecture","microservice-messaging","redis","symfony"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adrianosferreira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-06T20:31:26.000Z","updated_at":"2024-08-08T14:03:03.000Z","dependencies_parsed_at":"2023-03-08T22:45:28.680Z","dependency_job_id":null,"html_url":"https://github.com/adrianosferreira/microservice-messaging","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianosferreira%2Fmicroservice-messaging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianosferreira%2Fmicroservice-messaging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianosferreira%2Fmicroservice-messaging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianosferreira%2Fmicroservice-messaging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrianosferreira","download_url":"https://codeload.github.com/adrianosferreira/microservice-messaging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231583023,"owners_count":18395827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["daemon","docker","message-broker","microservice-architecture","microservice-messaging","redis","symfony"],"created_at":"2024-11-07T11:24:38.587Z","updated_at":"2024-12-28T04:14:50.002Z","avatar_url":"https://github.com/adrianosferreira.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microservice Messaging\n\n[![Build Status](https://travis-ci.org/adrianosferreira/microservice-messaging.svg?branch=master)](https://travis-ci.org/adrianosferreira/microservice-messaging)\n\n\nThis is a very basic example of how to implement a messaging system for a microservice architecture using Redis, Symfony, and Docker.\n\n![Microservice Message Broker](draw.png \"Microservice Message Broker\")\n\nThe complete system is divided into Customer Service, Order Service, and a Message Broker. Check below more details about each service. \n\n## Customer Service\n\nResponsible by managing customer's data. It stores data in a MySQL database and provides a REST api containing two endpoints, one for creating a customer and one for listing existing customers:\n\n- GET | http://localhost:8882/api/customers\n- POST | http://localhost:8882/api/customer - parameters name, surname, total, status.\n\nThis service is connected into Redis for publishing a message when new customers are added. This message will be used later by the Order Service for adding an order for this customer when notified by the Daemon service.\n\n## Order Service\n\nIt is responsible by managing order's data. It stores data in a MySQL database table and provides a REST api containing a single endpoint for listing all the existing orders:\n\n- GET | http://localhost:8881/api/orders\n\nThis service contains a daemon system, which subscribes into Redis in order to be notified as soon as a new customer is added, adding then the new order in the database.\n\n## Message Broker (Redis)\n\nRedis comes with a powerful pub/sub system, so here it is used in order to publish and subscribe into a particular channel for making the isolated systems talk to each other.\n\n## Running the Project\n\nFor running this all you need is Docker installed on your machine. This project comes with a `docker-compose.yaml` containing all the configuration for running the services.\n\nYou should run `docker-compose up` from inside of the root folder. Docker will map the port 8881 with the order application and 8882 with the customer application.\n\nNotice that in the last endpoint you are also sending some information that is not related to the customer (total and status) this is because imagine that you are ready to send your order but first you must register a new user for the visitor. After registering the new user it is time to register its order and it is Redis the one responsible by setting up the communication.\n\nAlso, you must execute the daemon application which comes with the Order Service, for this follow the steps below:\n- Run `docker exec -ti CONTAINER_ID bash` (the container of the Order Service)\n- Navigate into `/var/www/html/app/bin`\n- Run `php daemon`\n- Keep watching this terminal while you use the endpoint for creating a new customer\n\nAll done, have fun!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianosferreira%2Fmicroservice-messaging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrianosferreira%2Fmicroservice-messaging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianosferreira%2Fmicroservice-messaging/lists"}