Redis Cluster Data Migration
In a previous article Understanding Redis Cluster Principles Through Hands-on Practice, we briefly introduced the design principles of Redis Cluster. Data in Redis Cluster is distributed across 16384 slots according to certain rules, and these slots are mapped to different nodes based on the configuration. We know that after the cluster is running stably, data can still be transferred at the slot level. However, I’ve never been entirely sure about the specific transfer process, including clus...
JStorm Source Code Analysis: The Loop Task AsyncLoopThread
OverviewAsyncLoopThread is a custom loop task execution utility in JStorm. The implementation is not complex, and on its own may not warrant a dedicated article. However, it is so widely used in JStorm — for features such as supervisor/nimbus heartbeat, fetching new topologies, updating worker status, and many more — that it’s worth introducing here, as it will also help with reading other parts of the codebase. UsageAsyncLoopThread can actually be extracted and used in your own projec...
ActiveMQ Feature - Persistence
IntroductionData persistence is a concern that many systems deal with, especially for systems like Redis and ActiveMQ where data is primarily stored in memory. Since data is stored in memory, there is a risk of data loss when the system crashes. The solution to this problem is to write data to disk through some mechanism — that is, persistence. ActiveMQ provides three persistence methods, based on JDBC, KahaDB, and LevelDB respectively. Currently, the officially recommended method is KahaDB-b...
ActiveMQ Installation and Basic Usage
InstallationDownload the latest version from the official website, extract it, and the only prerequisite is to install JDK. Starting from ActiveMQ 5.14, only JDK 8 is supported. ConfigurationThe core configuration file is activemq.xml in the conf directory. The default configuration can be used without modification. Other configuration details will be introduced in subsequent articles when discussing the various features of ActiveMQ. StartingRun activemq start in the bin directory. After star...
ActiveMQ Series - Overview
ActiveMQ is a messaging middleware (MOM) based on the JMS protocol. When introducing ActiveMQ, we inevitably need to talk about messaging middleware and JMS. Messaging middleware is a very common component in distributed systems, providing a flexible mechanism to integrate different applications. Applications do not communicate directly with each other, but instead communicate through the messaging middleware acting as an intermediary. Messaging middleware serves two main purposes: decoupling...
Hexo Tutorial: Setting Up a Blog System and Deploying to GitHub
Original article: https://lichuanyang.top/posts/19890/ Hexo is an open-source blog system. For a backend developer who doesn’t want to deal with frontend stuff, but still finds platforms like CSDN and cnblogs inconvenient, and building your own blog from scratch is troublesome and ugly — I stumbled upon Hexo, which is extremely friendly for backend developers. So I’m writing this article to document the Hexo installation, some key configurations, and the process of deploying to GitHub. Instal...
Exporting JStorm Monitoring Metrics to Third-Party Storage
JStorm’s UI provides a large number of very detailed monitoring parameters, which are extremely helpful for troubleshooting. For information about the UI, you can refer to my previous article: https://lichuanyang.top/posts/31996/. However, using the UI can sometimes be inconvenient, for example when you need to query historical data. Therefore, we want to export monitoring data to other storage media for easier subsequent querying and analysis. Since JStorm’s monitoring has been completely re...
Camel Series: Using Camel Debugger
Apache Camel is a powerful tool for data routing, very convenient to use. However, at the same time, there is a problem: because it’s overly well-encapsulated, hiding many technical details, troubleshooting can be difficult when issues arise. Fortunately, the official team provides a debug tool that can help us set breakpoints and debug normally. http://camel.apache.org/debugger.html. This article will supplement the official documentation. First, you need to import the camel-test package: 12...
JStorm Source Code Analysis: Bolt Exception Handling
ProblemAnyone who has used Storm or JStorm knows that if an uncaught exception occurs in bolt code, the worker process will exit. This article analyzes the specific design from a source code perspective. It’s actually not as simple as “an exception occurs and then the process crashes.” The TruthLet’s first look at the source code of BasicBoltExecutor: 123456789101112public void execute(Tuple input) { _collector.setContext(input); try { _bolt.execute(input, _collector); ...
Dynamically Adding Appenders to Log4j
In addition to configuring Log4j through configuration files in formats such as properties and XML, Log4j also provides various interfaces that allow you to dynamically modify Log4j configuration using code, such as adding an appender to a logger. The method is straightforward: create a new appender and add it to the logger. Here is a sample code: 123456789KafkaLog4jAppender kafkaAppender = new KafkaLog4jAppender();kafkaAppender.setBrokerList(broker);kafkaAppender.setTopic(topic);kafkaAppende...














