Cloud Album
A private cloud photo album for overseas users, focused on backup, organization, and subscription-ready experiences.
A real product journey covering the iOS client, MinIO storage, overseas payments, and growth experiments.
Products
Small, useful products backed by the engineering notes on this site.
A private cloud photo album for overseas users, focused on backup, organization, and subscription-ready experiences.
A real product journey covering the iOS client, MinIO storage, overseas payments, and growth experiments.
Blog
A Java agent can observe or transform classes as the JVM loads them. Startup agents enter through premain; agents attached to a running JVM enter through agentmain.
Enable scheduling with @EnableScheduling, then annotate managed bean methods with @Scheduled.
A RocketMQ cluster normally uses multiple independent NameServers and one or more broker groups. Each broker group has a stable brokerName; broker ID 0 is the primary and nonzero IDs are replicas in older master/slave terminology.
RocketMQ is a distributed messaging platform built around NameServer discovery, brokers that store messages, producers, consumers, topics, and message queues.
Loading ten million rows into a Java List is rarely safe. It can create a long transaction, exhaust heap memory, and overload the database. First decide whether the job is an online query, offline export, or migration, then choose streaming or partitioned processing.
A basic crawler downloads a page, verifies the response, parses the HTML, extracts required fields, and stores normalized results.
Redis 3.2.10 is a historical release. Use it only for legacy compatibility and isolate it from untrusted networks.
Apache HttpClient can preserve cookies between requests through a shared CookieStore and request context.
This note explains a typical Java startup command used while running load tests on Linux:
java -server \
-XX:+HeapDumpOnOutOfMemoryError \
-Xms512m \
-Xmx512m \
-XX:+UseG1GC \
-XX:MaxGCPauseMillis=250 \
-XX:G1ReservePercent=20 \
-Djava.security.egd=file:/dev/urandom \
-jar xxxx.jar
JVM options must appear before -jar or the main class. Application arguments belong after the JAR name or main class. When diagnosing startup problems, record the exact command, Java version, environment variables, operating-system limits, and container memory limits.
Production Java processes should normally be managed by systemd, a container orchestrator, or another supervisor. Searching ps output and killing a matched PID is fragile: it can select the grep process, match multiple applications, or start a duplicate instance.