Running microservices using Reactor container - Phoesion Glow
George Papadopoulos
Posted on April 24, 2023
What is Phoesion Glow
Phoesion Glow is a framework for developing cloud microservices using c#. It offers out-of-the-box API-Gateway, Service-bus, service hosts, Kubernetes operators and more! All components have been designed to work together seamlessly and provide a uniform and streamlined experience for developing, deploying and managing your cloud services.
What is Phoesion Glow Reactor
Phoesion Glow Reactor is a standalone meta-app that includes all entities needed to run a Glow cloud setup, inside a single process/app. This includes the Prism (API Gateway), the Kaleidoscope (Service-Bus), Lighthouse (Command-and-Control) and Firefly (business logic service host/supervisor). Using Reactor you can easily develop your services locally without setting up a bunch of components.
Using Containers
Normally, when you install Phoesion Glow Blaze the Reactor is also installed as a system service. This is great most of the time but in many cases, when you want to evaluate the samples, run services in a non-developer PC, or just use a different version of Reactor, docker and containers come to the rescue. With one simple command, you can have the Reactor container up and running on your machine so your services can connect to it and attach on the service bus (to start handling incoming requests).
To start a Phoesion Glow Reactor container run :
docker run --name reactor -d -p 80:80 -p 443:443 -p 15000-15010:15000-15010 -p 16000:16000 phoesion/phoesion.glow.reactor-dev
This will start the reactor and expose the appropriate ports (http(s) and service-bus)
Running a sample
Now that our container is up and running, we can run some samples!
1. Clone the GitHub sample repo :
git clone https://github.com/Phoesion/Glow-Samples.git
2. Start the 1_Rest sample that demonstrates basic web api concepts/capabilities :
- Open the solution 1_REST\Sample_1_REST.sln
- Start Foompany.Services.SampleService1 and Foompany.Services.SampleService2 projects (our two microservices)
3. Test our services using the URLs :
- http://localhost/SampleService1/SampleModule1/
- http://localhost/SampleService1/SampleModule1/Action1
- http://localhost/SampleService1/SampleModule1/Action2/test?myKey=myValue
- http://localhost/SampleService1/SampleModule1/Action3?value1=hi&value2=true
- http://localhost/SampleService1/SampleModule1/DoTheThing?username=john
- http://localhost/SampleService1/SampleModule2/Action1
- http://localhost/SampleService1/SampleModule2/AsyncAction
- http://localhost/SampleService1/SampleModule2/SampleStrongType
- http://localhost/SampleService1/SampleModule2/SampleObjectType?retType=1
- http://localhost/SampleService2/SampleModule1/Action1
- http://localhost/SampleService2/SampleModule1/RedirectMe
- http://localhost/SampleService2/SampleModule1/SampleStatusCode?command=hi
- http://localhost/SampleService2/SampleModule1/SampleStatusCode?command=banana
- http://localhost/SampleService2/SampleModule1/StreamingSample1
- http://localhost/SampleService2/SampleModule1/FileDownloadSample
- http://localhost/SampleService2/SampleModule1/YieldReturnResults
- http://localhost/SampleService2/SampleModule1/
Summary
In this post, we saw how easy it is to create a Glow setup that includes the api-gateway, service-bus and more using Reactor and docker containers. With the Reactor container running we can launch our services locally for developing/testing/debugging or just evaluating them, without installing all the Phoesion Glow tools on our system.
For more information about Phoesion Glow, you can check out :
Happy coding!
Posted on April 24, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.