This Week in Spring - June 3rd, 2014

Engineering | Josh Long | June 03, 2014 | ...

Welcome to another installment of This Week in Spring. This week's an exciting week! Well, let's be honest. They're all exciting weeks. But in particular, this week's going to make a lot of people happy. Watch the blog and I'll see you back here next week to recap! :)

  1. Oh my goodness! Spring Boot 1.1.0.RC1 is now available! The new release maintains the epic with support for Spring Data Elasticsearch, HornetQ, and Spring Social, and a lot more! Grab the latest release, kick the tires, and feedback on Twitter or GitHub.
  2. Dr. Mark Pollack has just announced that the latest release of Spring XD, 1.0.0.M7 is now available. The new release provides a lot of great new features. My favorite is the ability to pin data to a certain stream - think of this as correllation using a message's content - so that you can preserve stateful operations. Think of this as a great way to route and divide messages based on a useful business key. There's a great example in the release notes.
  3. Azul rockstar Gil Tene gave an amazing talk on reducing latency for SpringOne2gX 2013 that is now available online. Gil is one of our industry's mad scientists. I haven't yet seen this talk, but I will, and I highly recommend that you do too. Azul makes high performance, low latency JVMs both as appliances and as deliverable software. His talks thus stem from a lot of thankless research and development that I'd just as soon spare myself by watching, and learning from, his talks. Go, Gil!
  4. June webinars are here! Michael Minella in Spring Batch 3.0.0 on June 10th, and Glenn Renfro in Spring Integration Done Boot-ifully on June 17th.
  5. Spring ninja Greg Turnquist has put together a teaser post on using the amazing when.js Promises/A+ implementation in a front-end REST client in advance of his SpringOne2GX 2014 talk. Check out the post and his talk at the conference!
  6. Ramnivas Laddad, a Spring ninja, original AspectJ leaders, and architects behind Cloud Foundry, has just posted a very cool look at Spring Cloud, which makes consuming client services from different middle/infrastructure services (a database, a message queue) on various Platforms-as-a-Service (PaaSes) a simple matter of platform-decoupling configuration.
  7. The replay of ADP's Jeffery Sologov's talk looking at the pitfalls of building large scale applications is now up! Check it out!
  8. ttp://twitter.com/JakubJirutka chimed in to tell us about this epic Spring Expression Language (SpEL)-powered implementation of the Bean Validation API (JSR 303/349). The GitHub offers an interesting point, "it’s especially very useful for cross-field validations that are very complicated with a plain Bean Validation." I love the examples, too:
     
    @SpELAssert(value = "password.equals(passwordVerify)",
            applyIf = "password || passwordVerify",
            message = "{validator.passwords_not_same}")
    public class User {
      private String password;
      private String passwordVerify;
    }
    

    Nice job!

  9. A hat tip to the amazing Brian Dussault for finding this: Zuul is a nifty looking application configuration management solution that offers a clean Spring client API.

  10. You know what made my day yesterday? A HystrixInvocationHandler. An InvocationHandler is used by the JDK (and Spring's rich proxying subsystem) to create proxies that wrap beans. This InvocationHandler wraps method invocations on a given bean in Netflix's OSS Hystrix project's Command objects. Hystrix Commands wrap functionality and provide/support resiliency patterns. I can't wait to see more of what becomes of Spencer Gibb's Halfpipe project!
  11. Our pal David Welch is at it again, this time with an interesting project called Spring Tiered, which aims to simplify even further (and normalize) the development of HATEOAS based services. Interesting...
  12. Also, speaking of building (and consuming) resilient services, check out Chris Richardson's fantastic talk from SpringOne2GX 2013 on powerful abstractions for consuming services asynchronously.
  13. Also, I put together a post talking about getting started with Maven (and alternatives) and Spring

Using new when.js 3.2.2 to build a front end for Spring Data REST

Engineering | Greg L. Turnquist | June 02, 2014 | ...

Greetings Spring community!

Roy Clarkson and I are presenting a talk at this year's SpringOne 2014 conference called Spring Data REST - Data Meets Hypermedia. We will explore how to quickly bridge the gap between a powerful Spring Data backend and a hypermedia enabled, RESTful front end.

In one part of the talk, we will delve into a javascript front end that lets the user takes pictures and upload them to a website. The website turns around and fetches images from the back end. By itself, this isn't that difficult thanks to the fully loaded RESTful API provided by Spring Data REST.

But fetching multiple images straight up isn't very efficient and is prone to freeze the web browser. Thanks to the CujoJS guys on our team (Brian Cavalier and John Hann), I was able to use the recently released when.js module

This Week in Spring - May 27th, 2014

Engineering | Josh Long | May 28, 2014 | ...

Welcome to another installment of This Week in Spring! Here in the States we had a 3-day weekend, which was nice. Good chance to watch some of those amazing tech talks! If you're like me, you've run out of tech talks, and will be glad to see that we have a lot more going up today!

  1. Grails project lead Graeme Rocher just announced Grails 2.4! The new release is amazing for a slew of reasons, not the least of which is that some of its many amazing features are easy to use with Spring Boot, too. Double win! Congratulations, Graeme and team. (And also thank you, for another amazing release!)
  2. Spring Boot 1.1.0.M2 is now available! The new release features improved support for Spring Data Solr, Spring Data Gemfire, and the entire Spring Data Dijkstra release train. The new release also offers GSP (Groovy Server Pages) and Velocity as templating options, along with upgrades to various libraries like Spring Security 3.2.4, and Spring Batch 3.0. This release train is moving quickly, so jump onboard while you can! There's a lot more great stuff, so check out the release notes.
  3. June webinars are here! Ramnivas Laddad on launches Spring Cloud on June 3rd in Abstracting PaaS services to be portable with Spring Cloud, Michael Minella in Spring Batch 3.0.0 on June 10th, and Glenn Renfro in Spring Integration Done Boot-ifully on June 17th.
  4. This blog introduces some of the limitations of Hibernate's inbuilt JDBC logging and then introduces log4jdbc as used in a simple Spring / Hibernate application.
  5. Our pal Eugen Paraschiv has put together a very nice introduction to Spring Data JPA.
  6. Matti Tahvonen over on the Vaadin team put together this fantastic introduction to using Spring Data Neo4j, Spring Boot, and of course the Vaadin4Spring library that Petter Holmström and I started. To be fair, it's only usable because of Petter :) So usable, in fact, that Matti was able to put together something beautiful - Bootiful - very quickly. Check it out! The application models (and visualizes!) data stored in Neo4j, so it's not just any old CRUD application, this is very cool!
  7. CloudFoundry ninja James Bayer announced the new Pivotal CF 1.2, which now supports VMWare's Hybrid Cloud Service, initial auditing and autoscaling, new data services (Redis, MongoDB, Neo4j, RiakCS, and ElasticSearch are all available!), and a lot more!
  8. Curiousity piqued? Want to learn more about CloudFoundry, the open-source Paas from Pivotal? Check out this epic video on how to setup your own Paas using BOSH from SpringOne2GX 2013. And hear about how other teams acutally did it in the SprignOne2GX replay - Free Yourself with CloudFoundry: A Private Cloud Experience.
  9. Data ninja Thomas Risberg just announced the new Spring for Apache Hadoop RC4 release, which is awesome! The new release improves upon the Spring YARN integration. YARN, of course, is the distributed, generic runtime on top of which Hadoop 2.0's very specific map/reduce support now sits. You can use YARN for job distribution of your own, however. You might, for example, use YARN to split up Spring Batch workloads. In the new example, Janne Valkealahti demonstrates a simple Spring Boot-powered Spring YARN component. It's amazing how concise this stuff is now!
  10. Want to learn more about Janne Valkealahti, the mad (data) scientist behind our Spring YARN support? Check out this Pivotal People profile!
  11. Spring Data lead Oliver Gierke does a nice job introducing the new hotness in Spring Data Dijkstra, the new Spring Data umbrella release. This release includes Java 8 Optional support, asynchronous repository method invocations, and more.
  12. Spring Security lead Rob Winch has just two small, bugfixe releases: Spring LDAP 2.0.2, and Spring Security 3.2.4
  13. Spring Web Services lead Arjen Poutsma has just announced Spring Web Services 2.2.0, which now features a Java configuration API and much more.
  14. Let me take a moment to remind everyone: Java configuration is everywhere! Spring framework, Boot, Data, Security, MVC, Integration, Batch, Social, and much more, all offer as-rich-as-the-XML Java configuration integrations. In the case of Boot, Java configuration is the only out-of-the-box option, though of course you can use XML if you'd like. It's just.. not expected.
  15. Spring Security lead also blogged about using Spring Security Test to handle web security
  16. Want to write your own Spring Boot starter? Check out this example from Spring ninja Stephane Nicoll on how to provide a HornetQ starter for Spring Boot
  17. At long last, Spring Social Google 1.0.0.GA has been released! Congratulations, Gabriel, on all the work required to arrive here. I like the easy-to-use example, too.
  18. Arnaud Giuliani has put together a very cool look at using GWT with Spring Boot. Nicely done, Arnaud!
  19. Netflix engineer Tomas Lin tweeted a link to a convenient Spring MVC exception handler for REST APIs. This is one (fine) way to approach the problem. As an alternative, I'd suggest you take a look at [using Spring HATEOAS' VndError(s) support]a).

Using the innovative Groovy template engine in Spring Boot

Engineering | Cédric Champeau | May 28, 2014 | ...

With the release of Spring Boot 1.1.0.M2 came the support for the new template engine that Groovy 2.3 provides. In this post, we will describe the benefits of using such an engine and of course how you can use it in Boot.

All the source code in this post is available on GitHub, so feel free to clone the repository and give it a try:

git clone https://github.com/melix/springboot-groovytemplates.git
cd springboot-groovytemplates
./gradlew run

Then open your browser on http://localhost:8080

This application is fully written in Groovy and also makes use of GORM for Boot, but it is of course…

Spring Boot 1.1.0.M2 Available Now

Engineering | Dave Syer | May 27, 2014 | ...

Spring Boot 1.1.0.M2 is available now in the Spring repositories. There are quite a few new features and plenty of new documentation:

  • Groovy Template and Velocity support for MVC and offline rendering.

  • Big changes to the HealthIndicator interface and the existing implementations, e.g. all database backends (like Mongo etc.) have a default HealthIndicator and the Actuator aggregates them all up into a single readout.

  • Support for Spring Data Solr and Spring Data Gemfire, and upgrade to the Spring Data Dijkstra release train

  • Support for multiple DataSources through a convenient

DataSourceBuilder abstraction, plus a similar feature for JPA

Preview Spring Security Test: Web Security

Engineering | Rob Winch | May 23, 2014 | ...

[callout title=Updated March 31 2015]This blog is outdated and no longer maintained. Please refer to the Test Section of the reference documentation for updated documentation. [/callout]

In my previous blog we demonstrated how the new Spring Security testing support can ease testing method based security. In this blog we will explore how we can use the testing support with Spring MVC Test.

Setting Up MockMvc and Spring Security

In order to use Spring Security with Spring MVC Test it is necessary to add the Spring Security FilterChainProxy as a Filter. For example:

@RunWith(SpringJUnit…

Preview Spring Security Test: HtmlUnit

Engineering | Rob Winch | May 23, 2014 | ...

[callout title=Updated March 31 2015]This blog is outdated and no longer maintained. Please refer to the Test Section of the reference documentation for updated documentation. [/callout]

In my previous blog we explored how we can use the testing support with Spring MVC Test. We will now see how the same support works with Spring Test MVC HtmlUnit.

[callout title=Minimum Versions]The Spring Security testing support does not work with spring-test-mvc-htmlunit-1.0.0.M1.jar. Instead, you just use the latest snapshot. This is due to some slight modifications to allow Spring Security and the…

What's New In Spring Data Dijkstra?

Engineering | Oliver Drotbohm | May 21, 2014 | ...

We've just announced the availability of the GA release of the Spring Data release train named Dijkstra. I'd like to use this chance to walk you through some of the features we added in this release.

5 new modules joining the train

The first big feature the release includes is the addition of 5 modules to the release train. Most of them have been around for quite a while but going forward we'll release them in sync with the other modules. The newly added modules are Spring Data Elasticsearch, Cassandra, Couchbase, Gemfire and Redis.

Spring Data Commons

A lot of the improvements of a release…

This Week in Spring - May 20th, 2014

Engineering | Josh Long | May 21, 2014 | ...

Welcome back to another installment of This Week in Spring! This week I'm in Krakow, Poland for Geecon, the Polish developer conference where, of course, I'll be speaking to developers about Spring. (and, maybe, Spring). If you're around, find me, I'll be wearing the giant Spring leaf t-shirt! :)

Other than that, there's a lot to get through so let's get to it!

  • In preparation for the upcoming Spring IO Platform, Spring Data release train Dijkstra has been released! This is a tremendous release train that includes: JPA, MongoDB, Neo4J, Apache Solr, Couchbase, Cassandra, Elasticsearch, Gemfire, Redis and Data REST! Congrats to the Spring Data Team!
  • Spring Boot 1.1.0 M1 is now available and introduces MongoDB and Gemfire support, as well as improved actuator metrics and health endpoints.
  • Final maintenance releases for the Spring Framework 3.2.x and 4.0.x versions are now available!
  • Spring Integration ninja (rockstar!) Artem Bilan put together a nice post introducing all the amazing Java configuration support in the nascent Spring Integration Java configuration DSL, which builds upon the basic @EnableIntegration support available in the just-released Spring Integration 4.0. You should read that post. Seriously. I want to steal some of Artem's thunder by excerpting this one amazing code-snippet:

    java @Bean IntegrationFlow helloWorldFlow() { return IntegrationFlows.from("helloWorldInput") .filter("World"::equals) .transform("Hello "::concat) .handle(System.out::println) .get(); } Yep! That's a Spring Integration flow that handles input messages, filters them, transforms them, and then gives them to the escape-hatch method, handle, which lets the developer insert any behavior into the mix. Remember, you can change anything about this - including where it gets the messages from and where it writes the messages to. Indeed, the output of one flow could be the input to another. Congratulations, Spring Integration team! Also, make sure to check out the launch webinar replay!

  • I know I mentioned this last week, but it's so worth a re-read! Groovy 2.3.0 is here! (Hah! Gotcha! This week's link was to a different post by the same author on the subject of the Groovy 2.3.0 release! But aren't you glad you read it, anyway?) Go, Groovy, go!
  • My pal Pieter Humphrey has done a nice introductory screencast on Spring XD - showing how to get up and running doing stream processing, and wiring it to an analytics dashboard in less than 7 minutes. XD uses a deceptively simple DSL (domain specific language) and no Java code - it's never been easier to work with Hadoop.
  • Spring Security lead Rob Winch has been moving heaven and earth to make unit-testing secure applications easier than ever. In this first installment of a new series, Rob looks at new annotations designed to stand in place of a live-fire Spring Security apparatus to mock a Principal, a UserDetailsService, and more. Check it out and stay tuned for more!
  • Speaking of Rob Winch, he gave an epic introduction to Spring Security at SpringOne2GX 2013 last year. This is a perfect place to jump onboard if you're new to Spring Security.
  • New Relic's Ashley Puls was kind enough to do a webinar with your humble author on Web Application Diagnostics using New Relic. Thanks, Ashley! I'll be very honest, this webinar was super informative for me. I knew just a little about New Relic, and in working through the development of the webinar I learned about a zillion and five use cases that are well served by New Relic. Really cool stuff!
  • Also published this week - a SpringOne2GX 2013 Replay by Emad Benjamin and Guillermo Tantucho: Virtualizing and Tuning Large Scale Java Platforms. This goes over JVM memory tuning and all the tricks and tips for getting Java to run well on a virtualized environment.
  • SpringOne2GX 2013 replay - a great talk from SAS Software: Migrating from WebLogic, WebSphere, JBoss to Pivotal tcServer. This might go well with a recent post on why App Servers are dead by Eberhard Wolff.
  • Do you love Spring's new home on the web, spring.io, as much as I do? Want to learn more? Check out this talk by project lead and Spring ninja Chris Beams on the makeup of the site, its development, and deployment.
  • Last week, Spring Data Neo4j lead and graph-ninja Michael Hunger and I gave a talk on Spring Boot and Neo4j. This talk was fun for me because it gave me a lot of excuses to play with Neo4j. In point of fact, Michael and I are doing a webinar on about the same subject on the 20th of May (that's 7 days away!), so come see what we've come up with. In the meantime, you may want to check out this recent post on creating a time-tree with Cypher, the language that Michael works on that's used to drive interactions with Neo4j. That post was, of course, a response to another post that Michael put together on importing forests into Neo4j, also worth a read!
  • I quite liked this post introducing how to setup a Spring Batch job using Spring Boot. The author found a comfortable configuration-middle ground in the Groovy BeanBuilder support, and describes it nicely in this post
  • Moritz Schulze has put together a very nice post, following others in the series, on how to integration test REST services
  • Are you using Spring Boot and want to use Spock? Netflix engineer Tomas Lin has put together an example on his GitHug page. Check it out!
  • Jakub Kubrynski has put together a nice post on how to use Spring Boot's org.springframework.boot.actuate.system.ApplicationPidListener (which Jakub contributed - thanks Jakub!) - to work with the application's process identifier (PID). Nice!
  • Meltdown 1.0.0 has been released! Meltdown is a Clojure interface to the Reactor project. So... functional programming and stream processing inside a lisp-like language? A dream! Check it out!

Get the Spring newsletter

Stay connected with the Spring newsletter

Subscribe

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all