Home » Tag Archives: Spring (page 11)

Tag Archives: Spring

Spring Cloud Sidecar – Initialization of Nodes

spring-interview-questions-answers

In the last blog post I had described how the Sidecar application can be used for registering the Cassandra nodes with Eureka and more generally can be used for registering any non-JVM application with Eureka. In this post I will cover how an application can go about querying the Sidecar registered nodes. Discovering Registered Nodes – Post Initialization If the ...

Read More »

Resource versioning with Spring MVC

spring-interview-questions-answers

When serving static resources, it is common practice to append some kind of version information to the resource URL. This allows the browser to cache resources for an unlimited time. Whenever the content of the resource is changed, the version information in the URL is changed too. The updated URL forces the client browser to discard the cached resource and ...

Read More »

Spring Cloud Sidecar

spring-interview-questions-answers

I have an application deployed to a NetflixOSS based cloud which has a structure along these lines: Essentially a service which persists information to a Cassandra cluster. All the applications are registered to Eureka – so in this instance the service as well as the Cassandra nodes are registered with Eureka, further the service connects to the Cassandra cluster by ...

Read More »

Rest client calls with Spring Cloud

spring-interview-questions-answers

There are a few interesting ways to make REST client calls with the Spring-Cloud project. Spring-Cloud rest support builds on top of the core Netflix OSS libraries, but abstracts them and in the process simplifies using the libraries. RestTemplate As a first step let us consider the traditional way to make Rest calls through Spring based applications, using RestTemplate: public ...

Read More »

Displaying progress of Spring application startup in web browser

spring-interview-questions-answers

When you restart your enterprise application, what do your clients see when they open the web browser? They see nothing, server doesn’t respond yet so web browser displays ERR_CONNECTION_REFUSED Web proxy (if any) in front of your application notices that it’s down and display “friendly” error message The website takes forever to load – it accepted socket connection and HTTP ...

Read More »

Integrate Redis to your Spring project

spring-interview-questions-answers

This article shows how to integrate Redis cache to your spring project through annotation configuration. We will begin with our Gradle configuration. We will use the jedis driver. group 'com.gkatzioura.spring' version '1.0-SNAPSHOT' apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: 'spring-boot' buildscript { repositories { mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.5.RELEASE") } } jar { baseName = 'gs-serving-web-content' ...

Read More »

Parameterized integration tests with Spring JUnit Rules

junit-logo

Spring 4.2 comes with brand new JUnit rules: SpringClassRule and SpringMethodRule. The main advantage of using JUnit rules is to let developers get rid of SpringJUnit4ClassRunner and utilize different JUnit runners in Spring integration tests. I think the biggest opportunity with Spring JUnit Rules is the ease of creating parameterized integration tests. The code to be tested For the purpose ...

Read More »

Set up a SpringData project using Apache Cassandra

apache-cassandra-logo

On this post we will use Gradle and spring boot in order to create a project that integrates spring-mvc and the Apache Cassandra database. First we will begin with our Gradle configuration group 'com.gkatzioura' version '1.0-SNAPSHOT' apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: 'spring-boot' buildscript { repositories { mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.5.RELEASE") } } jar ...

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:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials