Book Image

Hands-On Microservices with C#

By : Matt Cole
Book Image

Hands-On Microservices with C#

By: Matt Cole

Overview of this book

C# is a powerful language when it comes to building applications and software architecture using rich libraries and tools such as .NET. This book will harness the strength of C# in developing microservices architectures and applications. This book shows developers how to develop an enterprise-grade, event-driven, asynchronous, message-based microservice framework using C#, .NET, and various open source tools. We will discuss how to send and receive messages, how to design many types of microservice that are truly usable in a corporate environment. We will also dissect each case and explain the code, best practices, pros and cons, and more. Through our journey, we will use many open source tools, and create file monitors, a machine learning microservice, a quantitative financial microservice that can handle bonds and credit default swaps, a deployment microservice to show you how to better manage your deployments, and memory, health status, and other microservices. By the end of this book, you will have a complete microservice ecosystem you can place into production or customize in no time.
Table of Contents (16 chapters)
11
Trello Microservice – Board Status Updating
12
Microservice Manager – The Nexus

What this book covers

Chapter 1, Let's Talk Microservices, Messages, and Tools, covers all of our introductory material required for the rest of the book.

Chapter 2, ReflectInsight – Microservice Logging Redefined, gives a brief overview of ReflectInsight and the rich, powerful logging capabilities it has to offer.

Chapter 3, Creating a Base Microservice and Interface, creates a base class and interface we can use throughout the book and all of our microservices. We also discuss base classes, interfaces, and inheritance for those who need a quick refresher.

Chapter 4, Designing a Memory Management Microservice, develops a memory management microservice capable of tracing and reporting memory requirements. High CPU, too much RAM, garbage collection, all will be covered in the design. We will also cover why some of these things are important to know in a microservice ecosystem.

Chapter 5, Designing a Deployment Monitor Microservice, helps us develop a microservice capable of knowing about and monitoring deployments.

Chapter 6, Designing a Scheduling Microservice, develops a microservice that can execute scheduled jobs. While scheduling information is built within this microservice, the reader can open it up to use the messages we have shown thus far and drive the scheduled jobs from there.

Chapter 7, Designing an Email Microservice, covers a microservice that can send emails. Exercises are left for the user to expand this microservice to do even more. Separation of concerns is discussed in this chapter as well.

Chapter 8, Designing a File Monitoring Microservice, is where we make two microservices that are capable of listening to filesystem events and then posting those events via our messages. This is our first microservice that does not respond to a message but rather sends one when it needs to. The reader is free to expand this microservice to denote the hyperparameters needed to programmatically drive the file monitoring.

Chapter 9, Creating a Machine Learning Microservice, implements a CNN contained within a microservice. We will show how to control it asynchronously via messages.

Chapter 10, Creating a Quantitative Financial Microservice, develops a quant microservice capable of working with credit default swaps and bonds. This chapter is an exercise for the user to be able to adapt the microservice to their specific needs.

Chapter 11, Trello Microservice – Board Status Updating, works with the famous and intuituive Trello service, a Kanban board that is incredibly easy to use. We will show you how the microservice can programmatically add boards, lists, and cards. This can be adapted to Team Foundation Service, Jira, or an other Kanban board application that has a programmatical interface.

Chapter 12, Microservice Manager – The Nexus, develops a microservice whose job is to manage all the other microservices in the ecosystem. You will see how important it is to have such a microservice in your ecosystem, from health monitoring to job scheduling and more.

Chapter 13, Creating a Blockchain Bitcoin Microservice, implements a small blockchain microservice, and we will spend some of our money here. Cryptocurrency knowledge will not be covered, but it is hoped that again the creative juices will flow.

Chapter 14, Adding Speech and Search to Your Microservice, shows you how to add text-to-speech to your application. We will do this both in terms of speaking text, and also searching Wikipedia for results and then speaking those results aloud.

Appendix A, Best Practices, discusses best practices for designing and using your Microservice ecosystem.