Tag: java
All the articles with the tag "java".
Using JDK Flight Recorder to Troubleshoot Performance Issues in Production
This article explains how to continuously record JDK Flight Recorder data in production, periodically archive JFR files with a shell script, and use AI to analyze timelines, code, and thread evidence. The workflow helps SREs troubleshoot intermittent JVM performance issues such as slow responses, CPU spikes, and frequent garbage collection.
Kafka (Part 7): Integrating Apache Avro and Apicurio Schema Registry to Ensure Message Compatibility Between Producers and Consumers
To address deserialization failures caused by Kafka message format changes, this article walks through migrating from JSON to Avro and integrating Apicurio Schema Registry. It covers schema definition, Java class generation, producer and consumer configuration, and version compatibility checks, reducing the risk of poison-pill messages.
Understanding Java NIO (Part 3): I/O Multiplexing and the Reactor Pattern in Java, with Open-Source Framework Code Analysis
This post implements a Multi-Reactor server with Java NIO and explains how Channel, Buffer, Selector, and wakeup work together. It also covers cross-thread channel registration and dynamically adjusting read/write events, and analyzes how NIO is applied in the source code of Apache HttpClient and the Kafka client.
Understanding Java NIO (Part 2): I/O Multiplexing and Reactor Servers in C
Starting from the limitations of polling with nonblocking I/O, this post introduces select and epoll through C examples. It explains file descriptors, level-triggered and edge-triggered notifications, then combines connection management, I/O event handling, and a business thread pool into a Multi-Reactor server.
Understanding Java NIO (Part 1): Blocking I/O Servers in C with Processes, Threads, and Thread Pools
C implementations of blocking socket servers use a single process, multiple processes, multiple threads, and a thread pool to explain connection handling, file descriptors, and resource release. Comparing their concurrency and overhead establishes a foundation for nonblocking I/O and I/O multiplexing.
Enterprise JDK Upgrades (Part 1): Moving from JDK 11 to JDK 17
Using an upgrade of multiple company Java applications from JDK 11 to JDK 17, this article discusses compatibility checks and a staged migration. It covers changed exception messages, reflective-access restrictions, separate runtime and compile-time transitions, and supporting changes to Tomcat, Jenkins, and development environments.
Locks in Java (Part 4): High-Performance Web Page Caching with a Read-Write Lock
Starting with Ehcache 2 web-caching source code, this article analyzes the role of ReentrantReadWriteLock in concurrent cache loading. It then discusses an Ehcache 3 migration and how a custom Filter, cache keys, and a read-write lock cooperate to handle concurrent requests for the same page.
JDBC Streaming Reads and Correct Streaming Processing, with Examples
JDBC streaming reads.