Skip to main content

Posts

Showing posts from March, 2023

Apache Zookeeper On Java On Ease

  Its an open source coordination service for distributed application. It exposes simple set of primitive that a distributed application can built up on to implement higher level of services and synchronisation and also the configuration management. Yahoo, twitter, Netflix, facebook problem/solution : Coordination services : The process of integrating or communicating between services in distributed env. They are prone to, Race condition and dead-lock. Race condition : Two or more system trying to perform the same task. Dead-lock : Two or more system waiting on each other. Relieve distributed application from the responsibility of implementing the coordination service from scratch.  Coordination challenges :  Zookeeper is centralise coordination service is distribute and highly reliable running on cluster of service called zookeeper ensemble.  2 types of Nodes Leader Node : 1 Node processing for write request. Elected internally. More votes becomes leader. Recommende...

Content On JAVA On Ease

1. JAVA Releases  JAVA Releases 2. Bit Masking  Bit Masking 3. Splunk Queries for Log Monitoring  Splunk Query 4. Auto Retries on REST API  Auto Retries In REST 5. HTTP 1.x upgrade to HTTP 2  HTTP Upgrade 6. JAVA LTS  JAVA LTS

BIT Masking On Java On Ease

How to count set bits. For example the number 9 in binary form is : 1001                   1 00 1 there are 2 set (or 1) bits in 9. But how can we count them. Using below algo, we can count them int num = 9; int count = 0; while(num > 0) { count += num & 1; num >>= 1 } System.out.println("The output is : " + count);

Auto retries in REST API clients On Java On Ease

  Writing REST clients to consume API endpoints has become commonplace. While consuming REST endpoints, we sometimes end up in a situation where a downstream service throws some kind of transient error that goes away when the API call is retried. In such situations, we ask ourselves — “What if my API client was smart enough that knew how to retry a failed call?” Some of us go the extra mile to implement our own custom code that can retry API calls on error. But mind you, it is not only about knowing how to retry. The client also has to know when to retry and when not to. If the error is irrecoverable such as 400 — Bad Request, there is no point in retrying. It might also have to know how to back off and how to recover from the error. Implementing all this by hand, and then repeating it over and over again in every API client is cumbersome. It also adds a lot of boilerplate code and makes things even worse. But if you are a Spring/Spring Boot developer, you will be surprised to know...

HTTP 1.1 and HTTP 2 On Java On Ease

REST API In HTTP/2 HTTP/1.1 is good, but as our applications is growing in complexity , in size in scale etc. This is a great time to make the change to HTTP/2. HTTP/2 has a binary framing layer. Its backward compatibility with HTTP/1.x clients and servers.  New binary framing :  HTTP/1.x : Uses newline delimited text to transfer the data. It is more prone  to error compared to binary. HTTP/2 : It u ses binary format. I n the transfer layer. The design is to how the data is encoded between sockets and the HTTP APIs of our application. The web container will take care of encoding based on HTTp Version. traditional GET, PUT, POST, DELETE HTTP/2 breaks down the HTTP protocol communication into an exchange of binary-encoded frames, which are then mapped to messages that belong to a particular stream, all of which are multiplexed within a single TCP connection. 1.Binary Processing : Binary content is faster, lighter, and more compact. Instead of having four different message p...

JAVA Long-term support and What LTS means for the Java On Java On Ease

  LTS Focus is stability Java LTS releases, such as Java 11 and Java 17 The Java LTS releases provide only stability, security, and performance improvements—not new features.  This reduces the risk that an update could break interaction with a tool or library.  The provider of Java platform binaries offers its timelines and support offerings.  The default at Oracle is that there will be eight years of support for a Java SE LTS release. For Java 8, LTS has already been extended to at least 2030, this version will have at least 16 years of support when it’s finally retired! The current LTS versions of Java are Java 7, Java 8, Java 11, and soon, Java 17.  Java 11 and Java 17 came out under the new feature-release and three years apart.  Java 7 and Java 8 are major-release model. Oracle intends to support the Java LTS releases as follows: Java 7 through 2022 Java 8 through at least 2030 Java 11 through 2026 Java 17 through at least 2029 Home

JAVA Release (Version): On Java On Ease

  What are the various JAVA release versions and its release date: Java 8 – LTS release (Long Term Support), last LTS release before JPMS (modules) were introduced in Java 9 Java 11 – LTS release Java 17 – LTS release, the latest LTS release until September 2023 Java 19 – non-LTS release, the latest version released in September 2022 all other Java versions – non-LTS releases Whats LTS in JAVA