Home » Tag Archives: Spring (page 15)

Tag Archives: Spring

Learning Spring-Cloud – Infrastructure and Configuration

spring-interview-questions-answers

I got a chance to play with Spring-Cloud to create a sample set of cloud ready microservices and I am very impressed by how Spring-Cloud enables different infrastructure components and services to work together nicely. I am used to creating microservices based on Netflix OSS based stack and typically in a Netflix stack Eureka is considered the hub using which ...

Read More »

JavaEE or Spring? Neither! We Call Out For a Fresh Competitor!

spring-interview-questions-answers

If you’ve been following some key Java people on Twitter or reading the “news” on Reddit, you could not have missed the hilarious “bitch fight” (pardon my French) between some Spring and JavaEE evangelists. First, Jürgen Höller’s provocative article: “Happy second birthday, Java EE 7! How is it going in production?” Then, Reza Rahman’s response: “The Ghosts of Java EE ...

Read More »

RESTful Error Handling with Spring

spring-interview-questions-answers

This post will illustrate a way in which exception handling can be implemented for RESTful web services in Spring in such a manner that the exception handling concerns are separated from the application logic. Taking advantage of the @ControllerAdvice annotation we are able to create a global helper class for all controllers. By adding methods that we annotate with both ...

Read More »

Groovier Spring Boot Integration Testing

spring-interview-questions-answers

Recently I had a chance to use Groovy’s groovy.json.JsonSlurper in a soapUI REST project. The usage scenario in soapUI (in particular, soapUI Open Source) was very simple: in a Groovy assertion, load the content of a response into a variable and than verify it like this: import groovy.json.JsonSlurper; def slurper = new JsonSlurper() def result = slurper.parseText(messageExchange.responseContent) assert result.incidentType == ...

Read More »

Akka samples with scala and Spring

akka-logo

I was looking around recently for Akka samples with Spring and found a starter project which appeared to fit the bill well. The project however utilizes Spring-Scala which is an excellent project, but is no longer maintained. So I wanted to update the sample to use core Spring java libraries instead. So here is an attempt on a fork of ...

Read More »

Spring Integration Jdbc RowMapper Example

spring-interview-questions-answers

The JDBC inbound channel adapter’s basic function is to execute a SQL query, extract the data and pass the result set encapsulated in the form of a Message onto the local channels. You can read more about this in my example on JDBC Inbound Channel Adapter. The type of the payload is decided by the row-mapping strategy. The default one ...

Read More »

Spring lookup-method Example

spring-interview-questions-answers

When a bean has dependency on another bean, we inject the bean using the setter property or through the constructor. The getter method will return us the reference that is been set but suppose you want a new instance of the dependent bean each time you invoke the getter method, then you will probably have to follow a different approach. ...

Read More »

Configuration over JNDI in Spring Framework

spring-interview-questions-answers

From a certain point on, an application has to be configurable.  Spring Framework has a nice auxiliary tool for this issue since the first version 0.9 , the class PropertyPlaceholderConfigurer and since Spring Framework 3.1 the class PropertySourcesPlaceholderConfigurer. When you start a Google search for PropertyPlaceholderConfigurer, you will find many examples where the configuration items are saved in properties files. But ...

Read More »

Creating a Message Driven Bean with AWS SQS in Spring

spring-interview-questions-answers

In my previous post I showed a simple example how to use AWS SQS with Spring Framework to put messages on a queue and to read them from the queue. In this post I go one step further and use Spring to create a ‘Message Driven Bean’ so each message that is put on the queue is picked up and ...

Read More »

Logging JAX-WS SOAP messages in Spring

spring-interview-questions-answers

Whenever you’re using JAX-WS within Spring you’ll probably want to log the incoming and outgoing SOAP messages – if only for debugging during development. So the first thing to do is increase the log levels, right? Unfortunately this will have no effect. What you will have to do is to make use of the javax.xml.ws.handler.HandlerResolver interface. So how do we ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns