Interceptors in gRPC

Interceptors in gRPC

Many people I talk too are well aware of what middleware is. However, Interceptors seems to be less understood. Let’s dissect interceptors

What are they, and how do we use them?

Image for post

Photo by Thom on Unsplash

Many people I talk to are well aware of what middleware is. However, Interceptors seems to be less understood. Let’s dissect interceptors and learn how to use and write them and why we should do it.

gRPC is a great technology and I’ve been replacing many of my APIs with it. I’ve found that writing gRPC is easier than the regular HTTP based APIs. I suggest you invest time in learning it.

This is part 2 of a series, however, you don’t need prior knowledge and can continue without part 1 and 1.1, but I suggest reading them.

  • [Part 1] — using gRPC with TLS, Golang, React without Envoy
  • [Part 1.1] — Embedding a React application in a Golang binary
  • [̵P̵a̵r̵t̵ ̵2̵]̵ ̵-̵ ̵Y̵o̵u̵’̵r̵e̵ ̵h̵e̵r̵e̵
  • [Part 3] — Streaming data with gRPC

In a regular HTTP server, we would have a middleware wrapping our handler on the server. This middleware can be used to perform anything the server wants to do before actually serving the correct content, it can be Authentication or logging or anything.

gRPC is different, It allows Interceptors to be used in both the server and client. This is pretty nice since it allows users or consumers of APIs to add any wanted interceptor, such as custom logging.

Before we dig deep in interceptors I believe there is something in gRPC itself we need to understand. It’s the core concept of gRPC services

golang technology programming

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Golang Web Development:Th Best Programming Language in 2020

Golang Web Development is the new trend globally. Get all the details about the Golang development here. Hire Golang Developers.

Top five technologies among young entrepreneurs

With transformational changes seen in the business and technology front, Entrepreneurs’ view towards technologies is changing. Here are [the top technologies that young entrepreneurs can embed to increase their business...

Hire Dedicated Golang Developers | Golang Web Development Company

Hire dedicated GoLang developers from WebClues Infotech to build applications using Go language. Get best GoLang developers for your web development projects.

Asynchronous - Async programming  - Untangled

Asynchronous - Async programming  - Untangled . In the recent times there has been an increased emphasis on building high performance application which can perform better at scale to…

Top 10 Trending Technologies Must Learn in 2021 | igmGuru

Get updated with the newest top 10 trending technologies in 2021 which professional must learn to boost there career.