Skip to main content

Posts

Kafka And Zookeeper SetUp

 Kafka And Zookeeper SetUp zookeeper download Link : https://www.apache.org/dyn/closer.lua/zookeeper/zookeeper-3.8.3/apache-zookeeper-3.8.3-bin.tar.gz Configuration: zoo.conf # The number of milliseconds of each tick tickTime =2000 # The number of ticks that the initial # synchronization phase can take initLimit =10 # The number of ticks that can pass between # sending a request and getting an acknowledgement syncLimit =5 # the directory where the snapshot is stored. # do not use /tmp for storage, /tmp here is just # example sakes. dataDir =/tmp/zookeeper # the port at which the clients will connect clientPort =2181 4 char whitelist in command arguments 4lw.commands.whitelist =* Start ZooKeeper Server $ bin/zkServer.sh start Check zookeeper status dheeraj.kumar@Dheeraj-Kumar bin % echo stat | nc localhost 2181 stat is 4 character whitelisted argument  Check Kafka running status : echo dump | nc localhost 2181 | grep broker Responsibility of Leader in Zookeeper: 1. Distrib...

Ways of Sending Notification To External Application

 Sending notifications from your Spring Boot application to an external application can be achieved in various ways, depending on your specific requirements and the capabilities of the external application. Here are a few options: HTTP Webhooks: If the external application provides an HTTP endpoint (webhook) to receive notifications, you can send HTTP POST requests from your Spring Boot application to that endpoint whenever you want to send a notification. This is a simple and widely used method for integrating with external systems. Message Queues: Use a message queue system like Apache Kafka, RabbitMQ, or Apache ActiveMQ to send messages to the external application. Your Spring Boot application can produce messages to a topic/queue, and the external application can consume messages from that topic/queue. This approach decouples the sender and receiver, ensuring reliable delivery and scalability. RESTful API Calls: If the external application exposes RESTful APIs for receiving not...

Cache Management Policy

Cache management policies dictate how a cache interacts with the main memory when reading and writing data. These policies determine how data is stored in the cache, how it is retrieved, and when it is updated in both the cache and main memory. Here's a more concise and accurate explanation of how cache management policies affect these interactions: Read Operations: Read-Through Cache: When the CPU requests data and the cache misses (data is not in the cache), the cache forwards the request to the main memory. The main memory retrieves the requested data and sends it back to the cache. The cache then delivers the data to the CPU. The cache may update its content with the new data from the main memory, ensuring that the cache remains consistent. Advantages: Data Consistency: Ensures that the cache always contains up-to-date data from the main memory. This is crucial for applications where data consistency is paramount, such as databases or transaction processing systems. Simplicity:...

CPU Cache

A CPU cache is a small, high-speed, volatile storage component within the central processing unit (CPU) of a computer. Its primary purpose is to temporarily store frequently accessed data and instructions, thereby reducing the time it takes for the CPU to access and retrieve this information. Caches are crucial for improving a computer's overall performance, as they help to mitigate the speed gap between the fast CPU and the slower main memory (RAM). Here are some key points to help you understand CPU caches: Levels of Cache: Modern CPUs typically have multiple levels of cache, such as L1, L2, and L3. These caches are often referred to as the first-level cache (L1), second-level cache (L2), and third-level cache (L3). L1 cache is the smallest and closest to the CPU cores, while L3 cache is the largest but farther away in terms of access latency. Cache Hierarchy: The caches operate in a hierarchical manner, with L1 being the smallest but fastest and L3 being the largest but slower. ...