Published in Javarevisited·PinnedRead/Write in different DB Instances | Java | SpringThis Blog will explain how I route my spring boot application Database Calls into different DB instances based on the needs — I have a spring application that is using amazon Aurora DB Cluster as a data source. Amazon Aurora DB Cluster Two types of DB instances make up an Aurora DB cluster: Primary DB instance — Supports read and write operations, and performs all of the data modifications to the cluster volume. …Java4 min readJava4 min read
Published in Javarevisited·PinnedRemove Dirty NullChecks in JavaWhen I code something in Java, I am always worrying about NullPointerException. As a developer, I should provide error-free code. For some projects, I have worked in Javascript, I saw one beautiful/amazing thing in javascript. …Java2 min readJava2 min read
PinnedApache Kafka Beginner Guide — IEveryone knows how crucial is the starting point to add up a new piece to the head. If the new piece is Kafka then absolutely, you may confuse to start learning since there are so much information and ideas on the internet around Kafka. I will be pretty sure…Apache Kafka8 min readApache Kafka8 min read
Published in The Startup·PinnedTime Complexity Analysis of Dynamic Data StructureWhenever we need to analyze the time complexity of a particular operation, most of the time, we go with worst-case time analysis. Worst-case time analysis We find where the maximum number of code executions(code-wise) is executed for the given operation and calculate for n number of operations. When we need to find…Time Complexity4 min readTime Complexity4 min read
Published in தழலி·PinnedMember-onlyDocumenting Spring Boot API using Swagger2Developing an API is more relaxed than documenting an API. So how can we document an API? We have some tools that can generate the API documents for us automatically. We will see how we can document the Spring boot API with Swagger2. Swagger2 is a fantastic tool to document…Java9 min readJava9 min read
Published in Javarevisited·Jun 24, 2022How I handle Veracode Issue (CWE 117) Improper Output Neutralization for Logs | Java | Veracode FixesVeracode scanner is able to find the log forging attack. I recommend you scan your application with a Veracode scanner before going to production to ensure your application security. Why its an issue Writing untrusted data into a log file allows an attacker to forge log entries or inject malicious content into log files. Corrupted…Java2 min readJava2 min read
Mar 31, 2022Reactive Java World — 1Reactive Streams Specification has four interfaces to talk in a reactive way between the applications. Four Interfaces are Publisher Subscriber Subscription Processor Basically, when we need to consume data then we will act as subscribers. and there will be a source that acts as a publisher. We have to…Java2 min readJava2 min read
Published in Javarevisited·Mar 24, 2022Remove the if-else hellIn some cases, we need to do multiple if-else conditions like the above. Someone may prefer to go with a switch case, but it is not going to give clean and robust code. So How can we remove these multiple if-else conditions? We can do it with a map. For the String literals, you can use the…Java2 min readJava2 min read
Published in Javarevisited·Feb 3, 2022What’s a monitor in Java?Before jumping into Monitor, we need to understand two things. Mutual exclusion When a process/thread is executing its critical section no other processes are allowed to execute its critical section. (Each process has a code segment called “Critical section” in which shared data is accessed.) 2. Synchronisation When…Java4 min readJava4 min read
Published in Javarevisited·Jan 29, 2022Kafka Customer → Get Specific Messages OnlyThis is not a traditional spring Kafka consumer setup where the consumer actively listening to a particular topic. Kafka Customer can retrieve the message from the specified offset of the topic. Why we need Spring Kafka has a pattern to listen to topics actively(Kafka listeners). that’s what we need most of the time…Kafka3 min readKafka3 min read