All Posts

Kafka Go SDK Usage and Keypoints

In this article, I will use the Go language as an example to demonstrate how to produce and consume messages through Kafka using the Sarama SDK. For message consumption, I will demonstrate two modes: auto-committing messages that have been consumed and actively committing message consumption ACKs. In fact, this is also the practice of different message processing models (i.e., at most once and at least once). However, I will not demonstrate the mode of consuming messages exactly once here because this is not a feature supported by a simple message queue. It requires some additional business support, so I will only briefly discuss it without deep dive.

Install and Operate Kafka

I recently used Kafka in a project and wanted to learn more about it. This article will cover the installation of Kafka and some commonly used commands for operating it. These commands are essential for development and troubleshooting.

How Go Detect CPU Core in Container

While reviewing the implementation code of a library, I noticed its dependency on viewing the number of CPU cores being utilized by processes and then imposing certain restrictions based on that. Hence, I took a look at how Go implements viewing the number of CPU cores.

Cloudflare R2 Guidence

Recently, I've noticed that Cloudflare's features are becoming more robust. They have even started supporting object storage, and the free tier is quite appealing. Intrigued by this, I decided to give it a try. This article documents my experimentation process and provides an overview of some usage methods.

Thinking about Go Module

In this article, I provided a brief overview of the core problems that Go Module aims to address and how it tackles them. I also discussed potential challenges and their solutions. Finally, I will introduce several common compatibility strategies, which are learned from the official documentation.

How Go implement ReadWrite Deadline In TCP

When writing Go networking applications, there is a series of TCP connection methods that I use a lot: `SetDeadline`, `SetReadDeadline`, `SetWriteDeadline`. Their purpose is to wait for a read or write operation on a TCP connection, and if there is no read or write operation at the preset time point, the read method will ErrDeadlineExceeded` error, which is often used to determine if a connection has been lost. In this article, I'll describe how to use them and how Go implements them, and try to achieve a similar effect in C++.

Socket.IO Small Bug Introduce

Recently I took over a Web push gateway, the main function is actually through the Socket.IO protocol to receive the connection of the front-end, and then push the message to the corresponding front-end, however, during the debugging, we meet a issue that cann't connected successfully, and here we do a summary.

How to hide a linux process

Recently I came across a project: libprocesshider, which can be used to hide a Linux process, and for curious, I tried it out and found that it involves a few interesting points, so I’ll document it.

Edit Videos with FFMPEG

Often when watching or processing video, I have small, simple needs, such as intercepting a certain period of the video, or splitting a video into multiple videos according to the number of matches, because this need is so simple, it is not cost-effective to install a video processing software. So I tried to learn how to use it to process a simple video, and this article summarises the commands I used.

Go framework Gin: HTTP Handling

Gin is a popular HTTP framework and is used by a lot of people, but it is actually simple enough that there isn't much to say about it. However, although there is not much to talk about, there are some descriptions and ideas worth mentioning, and this is the first in a series of articles that will focus on how Gin handles HTTP requests. Since Gin essentially extends the native HTTP Server, there is not much to cover in terms of the network model, so this article focuses on some of Gin's main data structures and how they fit in with the native HTTP Server.