Posts

Understanding Epoch Time in Java & Spring Boot

Image
  Understanding Epoch Time in Java & Spring Boot 1. What Is Epoch Time? Epoch time (also known as Unix time ) is a numeric representation of time. It is defined as the number of seconds or milliseconds that have elapsed since : January 1, 1970, 00:00:00 UTC This reference point is called the Unix Epoch . Examples ·        0 → 1970-01-01 00:00:00 UTC ·        1700000000 → Epoch time in seconds ·        1700000000000 → Epoch time in milliseconds (commonly used in Java) Key Characteristics ·        Always based on UTC ·        Does not contain timezone information ·        Easy to store, compare, and sort ·        Widely used in APIs, databases, logs, and Kafka events 2. Epoch Time in Java / Spring Boot Java (8+) provides the mo...

Aspect-Oriented Programming (AOP) in Spring Boot

Aspect-Oriented Programming (AOP) in Spring Boot What is AOP? Aspect-Oriented Programming (AOP) is a programming paradigm that allows you to separate cross-cutting concerns from your business logic. Cross-cutting concerns are functionalities that affect multiple parts of an application, such as: Logging Security Transaction management Database routing Performance monitoring Understanding @Aspect and @Order(0) @Aspect Marks a class as an aspect - a modular unit of cross-cutting concern. It contains advice (code to execute) and pointcuts (where to execute). @Order(0) Defines the execution priority when multiple aspects target the same method: Lower numbers = Higher priority @Order(0) executes before @Order(1) , @Order(2) , etc. In this case, routing happens before Spring's @Transactional processing DataSourceRoutingAspect Explained @Aspect @Component @Order(0) // Execute BEFORE @Transactional aspect @Log4j2 public class DataSource...

Terraform

  1️⃣ Variables Purpose: Inputs to your Terraform configuration. variable "region" { type = string default = "us-east-1" } 👉 Used by providers, resources, and modules 👉 Loaded first 2️⃣ Providers Purpose: Tell Terraform which cloud / service API to talk to and how to authenticate . provider "aws" { region = var.region } 👉 Depend on variables 👉 Initialize during terraform init 3️⃣ Resources Purpose: Actual infrastructure objects (EC2, S3, Kafka topic, DB, etc.). resource "aws_s3_bucket" "data_bucket" { bucket = "my-bucket" } 👉 Depend on providers 👉 Can depend on variables and other resources 4️⃣ Data Sources Purpose: Read-only existing infrastructure. data "aws_vpc" "default" { default = true } 👉 Do not create anything 👉 Used by resources and modules 5️⃣ Modules Purpose: Reusable logical groups of Terraform code (like functions). module "network...

Kafka Avro Schema Evolution: Understanding Forward, Backward, and Full Compatibility

Image
Avro Schema Evolution: Understanding Forward, Backward, and Full Compatibility When working with event-driven architectures and streaming platforms like Kafka, schema evolution is crucial for maintaining system stability while allowing your data models to grow. Let's explore how Avro schema compatibility works using a real-world example from a sales order system. The Challenge: Evolving Return Status Enums Consider this Avro schema field that tracks return order statuses: { "doc": "Status code about this line in the Sales Order.", "name": "return_status", "type": [ "null", { "type": "enum", "name": "LineReturnStatus", "symbols": [ "NEW", "EXPECTED", "REGISTERED", "QUARANTINE", "RECEIVED", "INVOICED", "CANCELLED...

Agentic AI - KHub-JPS

  What is the best way to develop agentic ai systems ChatGPT said: Developing an effective  agent AI  (autonomous AI agent) depends on your goals, but the most successful approaches share a common structure. Here’s a concise, practical guide to building robust AI agents in 2025: 🚀  Best Way to Develop an Agent AI (2025 Guide) 1. Define the Agent’s Scope First Agents fail when they try to do everything. Start with: Clear objective  (e.g., “research a topic,” “automate email workflows,” “manage cloud infrastructure”) Constraints  (time, cost, safety boundaries) Environment  (web, files, APIs, local OS, cloud) 2. Choose a Modern Agent Framework These provide planning, memory, tools, and autonomy out-of-the-box: ⭐  Best current frameworks (2025) OpenAI Swarm  — lightweight multi-agent orchestration LangChain Agents  — tool-heavy, customizable AutoGen  (Microsoft) — multi-agent conversation loops LlamaIndex Agents  — strong retriev...