Category: fullstackdevelopment

  • How to install and set up Apache Kafka on Windows 10?

    Go to Apache kafka Website (https://kafka.apache.org/downloads) On clicking on download button you will be shown the below page: Click on any one of the binary downloads. You will be redirected to another page: Click on the link below HTTP header: A .tgz zipped file will be downloaded. Unzip this file by opening the command prompt…

  • How to focus on a text box/html element again after user interaction in Angular?

    Let’s say you want to focus on a html element as soon as user does something on your angular app. May be you want user to fill a set of fields and then on clicking submit button bring back the focus on the first field. How to do this? STEP1: Declare template variable name for…

  • How to implement distributed tracing using Spring Cloud Sleuth in Spring Boot?

    Microservices comes with many advantages. But there are disadvantages too. One of them is tracing the logs of your microservices. When there are so many microservices , user requests will span many of them and it will be difficult to trace the logs for a particular request when an issue occurs. To resolve this you…

  • How to fetch configuration data from config server in Spring Boot?

    Let’s say you have created a Spring Boot application and you fetch properties from application.yml file. Every time you want to change a property you need to restart your application. And if there are few more projects having similar configuration you need to replicate the properties in those applications as well. To solve this ,…

  • How to invoke OAuth2 protected microservice using WebClient in Spring Boot?

    Let’s say you want to call an OAuth2 protected microservice from your Spring Boot microservice application. Spring Boot as usual does majority of the work for us. We just need to add a dependency ,some configuration and using a single HTTP call using Spring Web Client we can invoke the microservice. Before that , to…

  • How to prevent basic auth pop up for invalid credentials in Spring Boot REST API?

    Let’s say you have created a backend REST API application in Spring Boot. Your front end application is deployed separately and it communicates with the backend via REST API calls. You decide to protect the backend with Spring Security. You also decide to use inbuilt Spring mechanism to validate login. So to authenticate a user…

  • How to create a custom Health Check in Spring Boot for Microservices?

    Let’s say you have three microservices in your application. One of the microservices connects to the other two microservices. And in addition it also connects to a database. You want to check the health status of this microservice and its dependent microservices and database. How to do this in Spring Boot? Spring Boot provides an…

  • Attribute vs Property in HTML

    The terms attribute and property can be confusing in HTML. For example the javascript framework Angular has the concepts Property Binding and Attribute Binding . Without knowing the difference between the two it is difficult to grasp the difference between those concepts. The major difference between the two is this: Attribute is related to HTML…

  • How to copy only updatable values while updating resources through Spring Boot REST API?

    Let’s say you are creating an application to manage your daily tasks. You decide to write REST APIs in Spring Boot. Following REST API conventions , You create an API named /tasks to create a new task using Http POST method. You store the task in database. You create an API with the same name…

  • What is “effectively final” in Java?

    Let’s say you don’t want a variable value to be changed once it is initialized. How to achieve this in Java? By declaring the variable as final. Now the variable becomes a constant and the compiler will complain if it is modified anywhere. There is one more concept of “final” in Java , which is…