SpringBoot Messaging with RabbitMQ

SpringBoot Messaging with RabbitMQ

RabbitMQ is one of the popular message broker solutions and provides client libraries to be used from various programming languages including Java, Scala, .NET, Go, Python, Ruby, PHP etc. In this tutorial, we will learn how to use RabbitMQ message broker to send and receive messages from a SpringBoot application. We will also look at how to send messages as JSON payloads and how to deal with errors using Dead Letter Queues (DLQ).

Continue reading »
Session Management using Spring Session with JDBC DataStore

Session Management using Spring Session with JDBC DataStore

In web applications, user session management is very crucial for managing user state. In this article, we are going to learn about what are the approaches we have been following to manage user sessions in a clustered environment and how we can use Spring Session to implement it in a much simpler and more scalable way. Typically in production environments, we will have multiple server nodes with a load balancer in front of them and all the client traffic will be coming through the load balancer to one of the server nodes.

Continue reading »
CI/CD for SpringBoot applications using Travis-CI

CI/CD for SpringBoot applications using Travis-CI

In this article we are going to learn how we can use Travis CI for Continuous Integration and Continuous Deployment (CI/CD) of a SpringBoot application. We will learn how to run maven build goals, perform test coverage validation using JaCoCo plugin, Code Quality checks using SonarCloud, build Docker image and push it to DockerHub and finally deploy it to Heroku. The source code for this article is at https://github.com/sivaprasadreddy/jblogger Last week I was talking to my friend about how easy it became to build a Java application and deploy it using SpringBoot.

Continue reading »
How was my year 2017 and my plans for 2018

How was my year 2017 and my plans for 2018

Happy new year to you :-) I don’t really believe in new year resolutions or making big 5 year plans!! But I do realize that by making a list of things that I want to do keeps me focus on those things and minimize the distractions. Before going to talk about my grand plans for 2018 let me take moment and see how was my 2017. What I did in 2017 I wrote a new book Beginning Spring Boot 2 with Apress publishers I learned a lot of good practices at ThoughtWorks I gave a conference talk on MicroServices at DevConHyd 2017 Conference I gave a GeekNight talk on Cloud Native Applications using SpringBoot and Spring Cloud I quit my job to start my own consulting gig Learned to Say NO The year 2017 is a wonderful year for me in many ways.

Continue reading »

My Review of Vlad Mihalcea’s High-Performance Java Persistence book

In Java world, JPA/Hibernate is the most popular and widely used framework. When it comes to overall performance of a software system database persistence layer plays the crucial role. The tricky part with JPA/Hibernate is it is very easy to get started but very very hard to master. This is where Vlad Mihalcea‘s High-Performance Java Persistence book helps you a lot. The High-Performance Java Persistence book is not just another Hibernate book saying you put this annotation here and call that method there and you are done.

Continue reading »

Select ALL starters on Spring Initializer (http://start.spring.io)

If you are working on Spring Boot then you most probably aware of Spring Initializer (http://start.spring.io) which is an online spring boot application generator. You can select the starters that you want to use and then generate the application. If you notice that there is no SELECT ALL option to select all the starters. Who would do that insane thing of selecting all the starters for an application??!!??? But, i would like to have the SELECT ALL option for one single reason:

Continue reading »

Spring Cloud Tutorials – Auto Refresh Config Changes using Spring Cloud Bus

Problem In the previous article Introduction to Spring Cloud Config Server we have seen how to use Spring Cloud Config Server. But, the problem is to reload the config changes in Config Client applications we need to trigger /refresh endpoint manually. This is not practical and viable if you have large number of applications. Solution Spring Cloud Bus module can be used to link multiple applications with a message broker and we can broadcast configuration changes.

Continue reading »

Spring Cloud Tutorials – Introduction to Spring Cloud Config Server

Problem SpringBoot provides lot of flexibility in externalizing configuration properties via properties or YAML files. We can also configure properties for each environment (dev, qa, prod etc) separately using profile specific configuration files such as application.properties, application-dev.properties, application-prod.properties etc. But once the application is started we can not update the properties at runtime. If we change the properties we need to restart the application to use the updated configuration properties.

Continue reading »

Getting Started with SpringBoot in Intellij IDEA Community Edition

We can use Intellij IDEA Community Edition for working with SpringBoot applications as we don’t need support for configuring servers like Tomcat, Wildlfy etc and can simply run the applications by running main() method. However, there is no provision in Intellij IDEA Community Edition to create SpringBoot application directly, the way it supports in Ultimate Edition. We can go to http://start.spring.io/ and generate the project and then import into our IDE.

Continue reading »

Update on SpringBoot : Learn By Example book

I would like to let you know that I have updated/added the following sections to my SpringBoot : Learn By Example book. Additions to existing chapters: Working with Multiple Databases Exposing JPA entities with bi-directional references through RESTful services In some of our applications we need to work with multiple databases. For example, we may have a primary database and a reporting database where most the application uses primary database and the application reports will be generated out of reporting database data.

Continue reading »