Subscribe to Blog via Email
Join 296 other subscribers-
Recent Posts
Recent Comments
- Wlodzimierz Kuczynski on Vamvakaris: The flood
- opoudjis on Which Indian states are well known in other countries?
- Test Test on Which Indian states are well known in other countries?
- opoudjis on Karamanlis and their food
- Stazybo Horn on Karamanlis and their food
Archives
- July 2023
- June 2023
- May 2023
- February 2023
- June 2022
- November 2021
- October 2021
- March 2019
- February 2019
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- September 2015
- February 2011
- January 2011
- November 2010
- July 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- July 2008
- June 2008
- November 2006
- October 2006
Categories
Meta
How can we build a microservice using Go?
Like you build a microservice in any other programming language, but with the advantage that concurrency is baked into the language.
You’ll need a messaging system as your backend for services, that can talk to Golang. Kafka will, and so will NATS.
You will need a HTTP server front end in Golang, that receives RESTful service calls and passes messages from the HTTP on to an incoming messaging queue, or reads messages from an outgoing messaging queue to HTTP. labstack/echo is an example of that.
You will need a message handler and distributor in Golang, that grabs messages from a messaging queue, invokes one or more microservices on them, and puts the output of those microservices on another messaging queue.
You will need a series of microservices, coded in Golang and all running at the same time, that read in a message and output a different message.
I did not build the base framework of nsip/nias2, the Golang Microservice set I’m contributing to; my CTO Matt Farmer did, and his code is very legible. Unlike mine.
And of course, consult How is Go (programming language) used in microservice architecture?
Leave a Reply