Skip to content

This consists of two microservices communicating with each other using Redis pub/sub. The first one is a REST API with the Gin library and publishes 'NewBook' events. The second service subscribes to the event and sends an email (mocked).

Notifications You must be signed in to change notification settings

go-related/redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Here I will demonstrate communication between 2 microservices, for simplicity reason we will have both of them into the same repository. To communicate we will use redis and to store data we will use postgresSQL.

  • Service 1
    • this will be a simple service with a Crud and will publish an event when create book call will happen.
  • Service 2
    • this will be the interested. once the event will be published this will send email(just log sm) to appropriate addresses.

Prerequisites

  • Redis docker
  • configuration for the service (there will be a sample on the repository)

Notes

  • build the application

    go build -o bin/redis
    
  • run service1

    ./bin/redis service1 
    

About

This consists of two microservices communicating with each other using Redis pub/sub. The first one is a REST API with the Gin library and publishes 'NewBook' events. The second service subscribes to the event and sends an email (mocked).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published