Home » Tag Archives: Spring (page 4)

Tag Archives: Spring

Why is Spring’s Health Down, Down, Up, Up, Up and Down again?

Why Our new JavaScript client application regularly calls the /health endpoint of our Grails backend to determine on- of offline state. Things started to become “funny” with it. This endpoint we get for free, since Grails is based on Spring Boot, which comes with a sub-project called Spring Boot Actuator. This gives us a a bunch of endpoints which allows ...

Read More »

Spring and Threads: Transactions

spring-interview-questions-answers

In order to be able to use transactions with our thread we need to understand how transactions work with spring. Transaction information in spring is stored in ThreadLocal variables. Therefore these variables are specific for an ongoing transaction on a single thread. When it comes to an action run by a single thread the transaction gets propagated among the spring ...

Read More »

Spring and Threads: Async

spring-interview-questions-answers

Previously we started working with spring and the TaskExecutor, thus we became more familiar on how to use threads on a spring application. However using the task executor might be cumbersome especially when we need to execute a simple action. Spring’s Asynchronous methods come to the rescue. Instead of messing with runnables and the TaskExecutor, you trade the control of ...

Read More »

Spring and Threads: TaskExecutor

spring-interview-questions-answers

Using threads in a web application is not unusual especially when you have to develop long running tasks. Considering spring we must pay extra attention and use the tools it already provides, instead of spawning our own threads. We want our threads to be managed by spring and thus be able to use the other components of our application without ...

Read More »

Converting XML to JSON & Raw Use in MongoDB & Spring Batch

Overview Why convert XML to JSON for raw use in MongoDB? Since MongoDB uses JSON documents in order to store records, just as tables and rows store records in a relational database, we naturally need to convert our XML to JSON. Some applications may need to store raw (unmodified) JSON because there is uncertainty in how the data will be ...

Read More »

Spring Cloud – Basic setup

spring-interview-questions-answers

Spring Cloud solves common problems of distributed systems. However, for someone who works only with widely known monolith applications jumping into the long list of patterns designed for distributed services might be quite overwhelming at the very beginning. This article will take you through the basics of Spring Cloud by taking a practical approach. After finishing, not only you should ...

Read More »

Secure Spring Boot REST API using Basic Authentication

spring-interview-questions-answers

This is the third post of my Spring Boot Blog post series. In the very first post, I talked about my experience with creating RESTFul Services using Spring Boot. Then I have expanded the sample to integrate with Swagger documentation. In this post, I am going to expand above sample with security aspect. What is API Security API Security is a ...

Read More »

Spring Batch CSV Processing

spring-interview-questions-answers

Overview Topics we will be discussing include the essential concepts of batch processing with Spring Batch and how to import the data from a CSV into a database. 0 – Spring Batch CSV Processing Example Application We are building an application that demonstrates the basics of Spring Batch for processing CSV files. Our demo application will allow us to process ...

Read More »

Differences between @RequestParam and @PathVariable annotations in Spring MVC?

spring-interview-questions-answers

The Spring MVC framework, one of the most popular frameworks for developing a web application in Java world also provides several useful annotations to extract data from the incoming request and mapping the request to controller e.g. @RequestMapping, @RequestParam, and @PathVariable. Even though both @RequestParam and @ParthVariable is used to extract values from the HTTP request, there is a subtle ...

Read More »