Spring-boot and Scala
There is actually nothing very special about writing a Spring-boot web application purely using Scala, it just works!In this blog entry, I will slowly transform a Java based Spring-boot application...
View ArticleMemoization of Scala Streams
I learnt the hard way that scala internally uses memoization with Streams. This was my first attempt at a solution to Euler Problem 5def from(n: Int): Stream[Int] = n #:: from(n + 1)def...
View ArticleSpring test with thymeleaf for views
I am a recent convert to thymeleaf for view templating in Spring based web applications, preferring it over jsp's. All the arguments that thymeleaf documentation makes on why thymeleaf over jsp holds...
View ArticleUsing Http Session with Spring based web applications
There are multiple ways to get hold of and use an Http session with a Spring based web application. This is a summarization based on an experience with a recent project.Approach 1Just inject in...
View ArticleSpring Boot and Scala with sbt as the build tool
Earlier I had blogged about using Scala with Spring Boot and how the combination just works. There was one issue with the previous approach though - the only way to run the earlier configuration was to...
View ArticleSpring Scala based sample bean configuration
I have been using Spring Scala for a toy project for the last few days and I have to say that it is a fantastic project, it simplifies Spring configuration even further when compared to the already...
View ArticleSpring Rest Controller with angularjs $resource
Angularjs ngResource is an angularjs module for interacting with REST based services. I used it recently for a small project with Spring MVC and wanted to document a configuration that worked well for...
View ArticleSpring Integration Java DSL sample
A new Java based DSL has now been introduced for Spring Integration which makes it possible to define the Spring Integration message flows using pure java based configuration instead of using the...
View ArticleThymeleaf - fragments and angularjs router partial views
One more of the many cool features of thymeleaf is the ability to render fragments of templates - I have found this to be an especially useful feature to use with AngularJs. AngularJS $routeProvider or...
View ArticleSpring Integration Java DSL sample - further simplification with Jms...
In an earlier blog entry I had touched on a fictitious rube goldberg flow for capitalizing a string through a complicated series of steps, the premise of the article was to introduce Spring Integration...
View ArticleScala Tail Recursion confusion
I was looking at a video of Martin Odersky's keynote during Scala Days 2014 and there was a sample tail recursion code that confused me:@tailrecprivate def sameLength[T, U](xs: List[T], ys: List[U]):...
View ArticleTailing a file - Spring Websocket sample
This is a sample that I have wanted to try for sometime - A Websocket application to tail the contents of a file.The following is the final view of the web-application:There are a few parts to this...
View ArticleDeploying a Spring boot application to Cloud Foundry with Spring-Cloud
I have a small Spring boot based application that uses a Postgres database as a datastore. I wanted to document the steps involved in deploying this sample application to Cloud Foundry. Some of the...
View ArticleGemFire XD cluster using Docker
I stared learning how to build and use Docker containers a few days back and one of my learning samples has been to build a series of docker containers to hold a Pivotal GemFire XD cluster.First the...
View ArticleSpring MVC endpoint documentation with Spring Boot
A long time ago I had posted about a way to document all the uri mappings exposed by a typical Spring MVC based application. The steps to do this however are very verbose and requires a fairly deep...
View ArticleCustomizing HttpMessageConverters with Spring Boot and Spring MVC
Exposing a REST based endpoint for a Spring Boot application or for that matter a straight Spring MVC application is straightforward, the following is a controller exposing an endpoint to create an...
View ArticleScala and Java 8 type inference in higher order functions sample
One of the concepts mentioned in the Functional Programming in Scala is about the type inference in higher order functions in Scala and how it fails in certain situations and a workaround for the same....
View ArticleSpring WebApplicationInitializer and ApplicationContextInitializer confusion
These are two concepts that I mix up occasionally - a WebApplicationInitializer and an ApplicationContextInitializer, and wanted to describe each of them to clarify them for myself. I have previously...
View ArticleSpring @Configuration and injecting bean dependencies as method parameters
One of the ways Spring recommends injecting inter-dependencies between beans is shown in the following sample copied from the Spring's reference guide here:@Configurationpublic class AppConfig { @Bean...
View ArticleSpring @Configuration - RabbitMQ connectivity
I have been playing around with converting an application that I have to use Spring @Configuration mechanism to configure connectivity to RabbitMQ - originally I had the configuration described using...
View Article