SpringSource

This Week in Spring - Sept 24th 2013

Hello everyone! Pieter posting this on Josh Long's behalf here... this week the Spring and Cloud Foundry teams are at JavaOne talking to developers about Spring, Cloud Foundry, Hadoop and big data! Happily, our pretty new @GoPivotal booth has garnered a lot of attention!

I met Duke, too! I think the big guy was as happy to see me as I was him!

  1. Spring ninja Greg Turnquist put together a nice post on how to contribute to Spring Boot with a pull request. The article does ultimately talk about the processing sending a pull request, but most of it's a really great introduction to extending Spring Boot to suit a new use case (like JMS, which simply hadn't been added yet). This post also introduces some cool features in Spring Boot, if you haven't learned about it yet.
  2. Speaking of Spring Boot, check out this upcoming Spring Boot webinar featuring project co-lead Phil Webb!
  3. Rossen Stoyanchev put together a knock-out piece how to build web applications that use websockets, or Sock.js, and how to then layer STOMP on top of that for an easier messaging-style interaction between the browser and the service.
  4. Rossen also has an upcoming webinar on Oct 8th, Building WebSocket Browser Applications with Spring, showing off the best of his SpringOne2GX 2013 session.
  5. I encourage you to check out the upcoming webinar featuring James Williams on building big data applications with Spring, Spring XD and Hadoop! This is going to be an awesome talk. James has some killer examples and knows his stuff.
  6. In related news, I put together a quick post on my thoughts on Data Integration, Stream Processing and Spring XD.
  7. Jakub Kubrynski has put together a nice post on how to use load-time weaving to inject dependencies into objects not managed by the Spring container using a couple of different approaches.
  8. Nitin Kumar put together a nice look at Spring Integration, a lightweight approach.
  9. Tomás Lin, who says that he loves testing Grails applications with Spock, put together a great post on how to test with Spring Boot with Spock.
  10. Sometimes, you need to do RMI, and when you do, Spring has you covered!
  11. The BitwiseOR blog has a great post on how to use Spring Boot to build REST services, using Groovy no less! Win! I'm not sure if I agree with the conclusion, but whatever it takes for people to be able to use this to simplify development, it's a win! And, with really great posts like this, hopefully it won't be long at all before everyone's bootstrapping their development, too!

Webinar: Building Big Data Applications with Hadoop & Spring

At Pivotal we are bringing two open source projects together -- Hadoop and the very rapid and widely used Spring java application development framework to help build Big Data Applications. While Hadoop is proving to be the defacto foundation for storing and processing data, real-world scenarios require much more. Millions of developers are already using Spring to create high performing, easily testable, reusable code without any lock-in. In this month's webinar James Williams will explore how Spring XD (Xtreme Data) is addressing Big Data Application needs including:

  • High throughput distributed data ingestion into HDFS from a variety of input sources
  • Real-time analytics at ingestion time, e.g. gathering metrics and counting values
  • Hadoop workflow management via batch jobs
  • High throughput data export, e.g. from HDFS to a RDBMS or NoSQL database.

Date: Thursday, October 3, 2013 Time: 9:00 AM, PST/5:00 PM, GMT Summer Time

Register http://play.gopivotal.com/Global_Hadoop_Spring_Webinar_Register.html

 

Building Big Data Applications with Hadoop & Spring

At Pivotal we are bringing two open source projects together -- Hadoop and the very rapid and widely used Spring java application development framework to help build Big Data Applications. While Hadoop is proving to be the defacto foundation for storing and processing data, real-world scenarios require much more. Millions of developers are already using Spring to create high performing, easily testable, reusable code without any lock-in. In this month's webinar James Williams will explore how Spring XD (Xtreme Data) is addressing Big Data Application needs including:

  • High throughput distributed data ingestion into HDFS from a variety of input sources
  • Real-time analytics at ingestion time, e.g. gathering metrics and counting values
  • Hadoop workflow management via batch jobs
  • High throughput data export, e.g. from HDFS to a RDBMS or NoSQL database.

Date: Thursday, October 3, 2013 Time: 9:00 AM, PST/5:00 PM, GMT Summer Time

Register http://play.gopivotal.com/Global_Hadoop_Spring_Webinar_Register.html

 

Webinar: Building WebSocket Browser Applications with Spring

So, you've written a "Hello world!" WebSocket application or perhaps even a chat sample. You're able to exchange messages even in pre-Servlet 3.1 containers and pre-IE 10 browsers (that don't yet support WebSocket) thanks to the SockJS protocol and Spring's support for it. However a message is a blank page that can have any content. Whatever message format you choose, proprietary or standard, both client and server need to understand it as well as distinguish different kinds of messages. You need support for the publish-subscribe pattern central to messaging applications so you can broadcast messages to one or more subscribers. You need to incorporate security, validation, and so on. In short you need to build a real-world application. If you're used to web applications (and Spring MVC annotated controllers) you are familiar with the foundation that HTTP provides including URLs (nouns), HTTP methods (verbs), headers, parameters, and others. Imagine building an application without HTTP, just a socket. WebSocket gives you this brand new, exciting capability -- full duplex, two-way communication -- yet you no longer have an application-level protocol. Can an entire application be built around a single Endpoint class processing all messages, assuming a single WebSocket connection between browser and server? Join Rossen Stoyanchev as he demonstrates that, thankfully, the WebSocket protocol has a built-in sub-protocol mechanism.

Europe

Tuesday, October 8 3:00PM GMT Summer Time London, GMT+01:00)

Register https://gopivotal.webex.com/gopivotal/onstage/g.php?t=a&d=667384670

 

North America

Tuesday, October 8 10:00AM PDT San Francisco, GMT-07:00)

Register https://gopivotal.webex.com/gopivotal/onstage/g.php?t=a&d=660130258

Contributing to Spring Boot with a pull request

In case you missed this year's SpringOne 2GX conference, one of the hot keynote items was the announcement of Spring Boot. Dave Syer showed how to rapidly create a Spring MVC app with code that would fit inside a single tweet. In this blog entry, I will peel back the covers of Spring Boot and show you how it works by putting together a pull request.

Autoconfiguration

Spring Boot has a powerful autoconfiguration feature. When it detects certain things on the classpath, it automatically creates beans. But one feature it doesn't yet have is support for Spring JMS. I need that feature!

The first step is to code an autoconfiguration class:

package org.springframework.boot.autoconfigure.jms; . . .some import statements. . . @Configuration @ConditionalOnClass(JmsTemplate.class) public class JmsTemplateAutoConfiguration { @Configuration @ConditionalOnMissingBean(JmsTemplate.class) protected static class JmsTemplateCreator { @Autowired ConnectionFactory connectionFactory; @Bean public JmsTemplate jmsTemplate() { JmsTemplate jmsTemplate = new JmsTemplate(connectionFactory); jmsTemplate.setPubSubDomain(true); return jmsTemplate; } } @Configuration @ConditionalOnClass(ActiveMQConnectionFactory.class) @ConditionalOnMissingBean(ConnectionFactory.class) protected static class ActiveMQConnectionFactoryCreator { @Bean ConnectionFactory connectionFactory() { return new ActiveMQConnectionFactory("vm://localhost"); } } }

My Spring JMS autoconfiguration class is flagged with Spring's @Configuration annotation, marking it as a source of Spring beans to be picked up and put into the application context. It leverages Spring 4's @Conditional annotations, limiting it to only add this set of beans if JmsTemplate is on the classpath. This is a telltale sign that spring-jms is on the classpath. Perfect!

My new class has two inner classes, also tagged for Spring Java Configuration and with additional conditions. This makes it easy to consolidate all my configuration needs to automate Spring JMS configuration.

  • JmsTemplateCreator creates a JmsTemplate. It only works if there isn't already a JmsTemplate defined elsewhere. This is how Spring Boot can have an opinion on how to create a JmsTemplate, but will quickly back off if you supply your own.
  • ActiveMQConnectionFactoryCreator creates an ActiveMQConnectionFactory, but only if it detects ActiveMQ on the classpath and if there is no other ConnectionFactory defined amongst all the Spring beans. This factory is necessary to create a JmsTemplate. It it set up for in-memory mode, meaning you don't even need to install a stand alone broker to begin using JMS. But you can easily substitute your own ConnectionFactory, and either way, Spring Boot will autowire it into the JmsTemplate.

All this autoconfiguration will be for naught if I don't properly register my new JmsTemplateAutoConfiguration. I do that by adding the FQDN to Spring Boot's spring.factories file.

. . . org.springframework.boot.autoconfigure.jms.JmsTemplateAutoConfiguration,\ . . .

Of course no pull request is complete without some automated unit tests. I won't put all the tests I wrote in this blog entry, but you can inspect the tests I submitted with my pull request. Just be ready to write your own battery of tests before submitting a pull request!

And that's all there is to adding autoconfiguration to Spring Boot! It's not that complex. In fact, you can take a tour of the existing autoconfiguration classes for more examples.

Spring Boot's Groovy support

One of the biggest features of Spring Boot that drew a lot of attention was its strong support for Groovy. This drew much applause during the keynote and was eaten up during Dave and Phil's talk the next day. In case you missed it, here is the Spring Boot REST service Dave Syer demonstrated:

@RestController class ThisWillActuallyRun { @RequestMapping("/") String home() { "Hello World!" } }

After putting that code inside app.groovy, Dave launched it by typing:

$ spring run app.groovy

Spring Boot's command line tool uses an embedded Groovy compiler and looks at all the symbols (like RestController). Then it automatically adds @Grab and import statements. It essentially expands the previous fragment into this:

@Grab("org.springframework.boot:spring-boot-starter-web:0.5.0.BUILD-SNAPSHOT") import org.springframework.web.bind.annotation.* import org.springframework.web.servlet.config.annotation.* import org.springframework.web.servlet.* import org.springframework.web.servlet.handler.* import org.springframework.http.* static import org.springframework.boot.cli.template.GroovyTemplate.template import org.springframework.boot.cli.compiler.autoconfigure.WebConfiguration @RestController class ThisWillActuallyRun { @RequestMapping("/") String home() { "Hello World!" } public static void main(String[] args) { SpringApplication.run(ThisWillActuallyRun, args) } } Adding your own Groovy integration

To add Spring JMS support, I need to add similar autoconfiguration to Boot's CLI so that whenever someone uses either a JmsTemplate, a DefaultMessageListenerContainer, or a SimpleMessageListenerContainer, it will add the right bits.

Before writing that code, I first wrote a simple Groovy script that uses the Spring JMS stuff in jms.groovy:

package org.test @Grab("org.apache.activemq:activemq-all:5.2.0") import java.util.concurrent.CountDownLatch @Configuration @Log class JmsExample implements CommandLineRunner { private CountDownLatch latch = new CountDownLatch(1) @Autowired JmsTemplate jmsTemplate @Bean DefaultMessageListenerContainer jmsListener(ConnectionFactory connectionFactory) { new DefaultMessageListenerContainer([ connectionFactory: connectionFactory, destinationName: "spring-boot", pubSubDomain: true, messageListener: new MessageListenerAdapter(new Receiver(latch:latch)) {{ defaultListenerMethod = "receive" }} ]) } void run(String... args) { def messageCreator = { session -> session.createObjectMessage("Greetings from Spring Boot via ActiveMQ") } as MessageCreator log.info "Sending JMS message..." jmsTemplate.send("spring-boot", messageCreator) latch.await() } } @Log class Receiver { CountDownLatch latch def receive(String message) { log.info "Received ${message}" latch.countDown() } }

This test script expects a JmsTemplate as well as a ConnectionFactory to be supplied automatically by Spring Boot. Notice that there are no import statements nor any @Grab's aside from pulling in activemq-all. It uses Spring Boot's CommandLineRunner interface to launch the run() method, which in turn sends a message through JmsTemplate. Then it uses the CountDownLatch to wait for a signal from the consumer.

On the other end is a DefaultMessageListener that upon receipt of the message, counts down. To invoke my script from inside Spring Boot's test suite, I added the following test method to SampleIntegrationTests to invoke jms.groovy:

@Test public void jmsSample() throws Exception { start("samples/jms.groovy"); String output = this.outputCapture.getOutputAndRelease(); assertTrue("Wrong output: " + output, output.contains("Received Greetings from Spring Boot via ActiveMQ")); FileUtil.forceDelete(new File("activemq-data")); // cleanup ActiveMQ cruft }

To test my new patch, I found it much easier to run a specific test. This definitely sped things up.

$ mvn clean -Dtest=SampleIntegrationTests#jmsSample test

Note: I had to run mvn -DskipTests install first to have my new JMS autoconfiguration feature deployed to my local maven repository.

Since I haven't written any Groovy autoconfiguration yet, the test will fail. Time to write the CLI autoconfiguration!

package org.springframework.boot.cli.compiler.autoconfigure; . . .import statements. . . public class JmsCompilerAutoConfiguration extends CompilerAutoConfiguration { @Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneFieldOrMethod(classNode, "JmsTemplate", "DefaultMessageListenerContainer", "SimpleMessageListenerContainer"); } @Override public void applyDependencies(DependencyCustomizer dependencies) throws CompilationFailedException { dependencies.add("org.springframework", "spring-jms", dependencies.getProperty("spring.version")).add( "org.apache.geronimo.specs", "geronimo-jms_1.1_spec", "1.1"); } @Override public void applyImports(ImportCustomizer imports) throws CompilationFailedException { imports.addStarImports("javax.jms", "org.springframework.jms.core", "org.springframework.jms.listener", "org.springframework.jms.listener.adapter"); } }

These callback hooks make it super easy to integrate with Spring Boot's CLI tool.

  • matches() lets you define what symbols trigger this behavior. For this one, if there is a JmsTemplate, DefaultMessageListenerContainer, or SimpleMessageListenerContainer, it will trigger the action.
  • applyDependencies() specifies exactly what libraries to add to the classpath via Maven coordinates. This is akin to adding @Grab annotations to the application. For this one, we need spring-jms for JmsTemplate and geronimo-jms for JMS API spec classes.
  • applyImports() adds import statements to the top of your code. I basically looked at the Spring JMS imports from the autoconfiguration test code, and added them here.

This time, if you run the test suite, it should pass.

$ mvn clean -Dtest=SampleIntegrationTests#jmsSample test . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v0.5.0.BUILD-SNAPSHOT) 2013-09-18 11:47:03.800 INFO 22969 --- [ runner-0] o.s.boot.SpringApplication : Starting application on retina with PID 22969 (/Users/gturnquist/.groovy/grapes/org.springframework.boot/spring-boot/jars/spring-boot-0.5.0.BUILD-SNAPSHOT.jar started by gturnquist) 2013-09-18 11:47:03.825 INFO 22969 --- [ runner-0] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@4670f288: startup date [Wed Sep 18 11:47:03 CDT 2013]; root of context hierarchy 2013-09-18 11:47:04.428 INFO 22969 --- [ runner-0] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 2147483647 2013-09-18 11:47:04.498 INFO 22969 --- [ runner-0] o.apache.activemq.broker.BrokerService : Using Persistence Adapter: AMQPersistenceAdapter(activemq-data/localhost) 2013-09-18 11:47:04.501 INFO 22969 --- [ runner-0] o.a.a.store.amq.AMQPersistenceAdapter : AMQStore starting using directory: activemq-data/localhost 2013-09-18 11:47:04.515 INFO 22969 --- [ runner-0] org.apache.activemq.kaha.impl.KahaStore : Kaha Store using data directory activemq-data/localhost/kr-store/state 2013-09-18 11:47:04.541 INFO 22969 --- [ runner-0] o.a.a.store.amq.AMQPersistenceAdapter : Active data files: [] 2013-09-18 11:47:04.586 INFO 22969 --- [ runner-0] o.apache.activemq.broker.BrokerService : ActiveMQ null JMS Message Broker (localhost) is starting 2013-09-18 11:47:04.587 INFO 22969 --- [ runner-0] o.apache.activemq.broker.BrokerService : For help or more information please see: http://activemq.apache.org/ 2013-09-18 11:47:04.697 INFO 22969 --- [ JMX connector] o.a.a.broker.jmx.ManagementContext : JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi 2013-09-18 11:47:04.812 INFO 22969 --- [ runner-0] org.apache.activemq.kaha.impl.KahaStore : Kaha Store using data directory activemq-data/localhost/kr-store/data 2013-09-18 11:47:04.814 INFO 22969 --- [ runner-0] o.apache.activemq.broker.BrokerService : ActiveMQ JMS Message Broker (localhost, ID:retina-51737-1379522824687-0:0) started 2013-09-18 11:47:04.817 INFO 22969 --- [ runner-0] o.a.activemq.broker.TransportConnector : Connector vm://localhost Started 2013-09-18 11:47:04.867 INFO 22969 --- [ runner-0] o.s.boot.SpringApplication : Started application in 1.218 seconds 2013-09-18 11:47:04.874 INFO 22969 --- [ runner-0] org.test.JmsExample : Sending JMS message... 2013-09-18 11:47:04.928 INFO 22969 --- [ jmsListener-1] org.test.Receiver : Received Greetings from Spring Boot via ActiveMQ 2013-09-18 11:47:04.931 INFO 22969 --- [ main] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@4670f288: startup date [Wed Sep 18 11:47:03 CDT 2013]; root of context hierarchy 2013-09-18 11:47:04.932 INFO 22969 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147483647 2013-09-18 11:47:05.933 INFO 22969 --- [ main] o.a.activemq.broker.TransportConnector : Connector vm://localhost Stopped 2013-09-18 11:47:05.933 INFO 22969 --- [ main] o.apache.activemq.broker.BrokerService : ActiveMQ Message Broker (localhost, ID:retina-51737-1379522824687-0:0) is shutting down 2013-09-18 11:47:05.944 INFO 22969 --- [ main] o.apache.activemq.broker.BrokerService : ActiveMQ JMS Message Broker (localhost, ID:retina-51737-1379522824687-0:0) stopped Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.432 sec - in org.springframework.boot.cli.SampleIntegrationTests

Ta dah!

At this stage, all I have to do is check out the contribution guidelines to ensure I am following Spring Boot's coding standards, and then submit my pull request. Feel free to see my contribution and follow up comments. (P.S. It was accepted after some fine tuning.)

I hope you have enjoyed this deep dive into Spring Boot and how it works. Hopefully, you will be able to code your own patch.

Webinar: Simplifying Spring with Spring Boot

Are you fed up with searching stackoverflow for copy-paste configuration, do you want to write apps that can 'just run'. Perhaps you are just starting out with Spring and want a quick way to learn the basics without manually downloading and installing half the Internet?

In this webinar Phil Webb will demonstrate how Spring Boot can take you from zero to Spring with minimal fuss. We will look at how you can rapidly prototype Spring applications using Groovy, and how Spring Configuration in Java applications can be radically simpler. We will show how you can embed tomcat into your applications and turn a few lines of Java into a production ready, executable jar that is less the 8 Mb.

Europe Thursday, September 26 3:00PM GMT Summer Time London, GMT+01:00) Register https://gopivotal.webex.com/gopivotal/onstage/g.php?t=a&d=661328789

North America Thursday, September 26 10:00AM PDT San Francisco, GMT-07:00)
Register https://gopivotal.webex.com/gopivotal/onstage/g.php?t=a&d=665169025

This Week in Spring - September 17, 2013

This Week in Spring

Welcome back to another installment of This Week in Spring! I'm still reeling from last week. If you were there, you know what I mean, if not, then look forward to the videos coming out over the coming months. There's so much stuff to see.

For those of you who were at the show and sought me out because of This Week in Spring, it was really great to meet you all!

The world keeps on spinning of course, so let's look at some of what's happened this last week.

  1. Jennifer Hickey has announced that Spring Data Redis 1.1 has been released. The new release provides support for pipelining, data type conversion, and a modified API for adding or removing multiple List, Set, and Hash elements all in one call. Great stuff, check it out!
  2. AspectJ, Scala, Cloud Foundry, and Spring framework ninja Ramnivas Laddad has just announced the first cut of the Spring Cloud project, which in turn is a revolutionary API that takes the cloudfoundry-runtime library previously used with Cloud Foundry applications to the next level, opening the doors for support of multiple providers. Nice job, Ramnivas! And, dear community, if you want to see more, now's the time to check out the code and sound off!
  3. Over on the @GoPivotal blog, Stacey Schneider has put together a very nice post on her experiences at her first SpringOne2GX last week. Great read, and I echo her sentiments, even though this was not my first SpringOne2gx! :)
  4. Didn't get enough Data-love last week? Spring Data ninja Oliver Gierke just announced the latest cuts of two community modules: the first milestone of Spring Data Couchbase lead by Michael Nitschinger and the 1.0 GA of Spring Data Solr lead by Christoph Strobl.
  5. I put together a blog that introduces some of the things required to make the Spring Social binding that Roy Clarkson and I demonstrated last week at SpringOne2GX work with Spring Android, specifically as concerns the loading of certain classes in Spring core, Spring Security and Spring HATEOAS. Check it out!
  6. Groovy/Grails, and Spring, Tool Suite ninja Martin Lippert has just announced the latest iteration of STS and GGTS, versions 3.4.0.M1, has been released!
  7. Our pal Tobias Flohre is at it again, this time with two great SpringOne2GX wrapup posts. The first looks at some of the Spring XD, Batch and Hadoop technologies demonstrated, and the second looks at Spring Boot and the Spring IO platform.
  8. Rossen Stoyanchev, the genius behind the websockets support in Spring 4, has put together an amazing slate of demos using WebSockets and STOMP (which you can work with from RabbbitMQ!) and he showed these demos off last week at SpringOne2GX 2013 to wide acclaim. Nice job! If you missed it last week, at least check out the code, now.
  9. The Ippon.fr blog has a nice (French-language!) interview with my pal Eric Bottard, a (French-speaking) developer on Spring XD. Good read!
  10. The fine folks over at IntelliGrape have put together a nice roundup of their favorite talks from SpringOne2GX on day 2. Check it out!

Doing the Maven Dependency Dance for Spring Android Projects

Some of the Things to Note When Using Spring Social with Spring Android

Roy Clarkson (@royclarkson) and I gave a talk at SpringOne2GX 2013 in which we talked about building REST services with an eye towards consuming those services on mobile platforms like Android and iOS. This talk demonstrates the progressive evolution of an application using Spring MVC, Spring HATEOAS, Spring Data REST, Spring Security, Spring Security OAuth, and Spring Android. The code's benefited from a lot of help from Rob Winch,

Layout of the Code

The code for the talk is on my GitHub account (github.com/joshlong/the-spring-rest-stack). Importantly, the code lives in the code directory. Beneath that there are two choices: web (where you'll find the rest, hateoas, hateoas-data, and oauth, social modules) and client (where you can load the Android module and the iOS module). The modules in the web folder in respective order, demonstrate the evolution of a simple REST service which incorporates hypermedia, Spring Data repositories and OAuth security. The social module demonstrates how to build an OAuth client that consumes the service.

Building and Editing the Code

The project is all, at the moment, Maven based, though moving to Gradle seems imminent as that is the Google-endorsed route for Android builds. I know the Android client to be importable and buildable using IntelliJ IDEA's Android support (which in theory should work in Android Studio, which is freely available).

The Dependency Dance and Android

We used up-to-date revisions of major libraries in our build file, linked for reference. Up-to-date and sometimes bleeding edge. The Android application uses the Spring Android project, which - basically - provides an API compatible implementation of the RestTemplate found in Spring core.

It does not however provide the entire framework, and if you bring in certain libraries from the core you'll get weird issues because some classes in the Spring Android modules are mostly the same in Spring Android and in the core, but they're not identical, due to the differing natures of the environments in which they run. The easiest way to ensure everything's OK is to explicitly exclude all Spring modules except the Spring Android dependencies then, selectively, re-introduce the types as you need them.

The types in the Spring Android RestTemplate module provides more than enough compatibility to let Spring Social's client machinery work unchanged on Android. This, of course, means that we can use the Spring Social-powered OAuth client in the social module in our Android application. Awesome!

For example, while I needed the Spring Social core types and implementations, I didn't need the core Spring libraries that it brought in. So, we get this rather dramatic stanza:

<dependency> <groupId>org.springframework.social</groupId> <artifactId>spring-social-core</artifactId> <version>${spring-social.version}</version> <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> </exclusion> <exclusion> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> </exclusion> <exclusion> <groupId>aopalliance</groupId> <artifactId>aopalliance</artifactId> </exclusion> <exclusion> <groupId>com.joshlong.restfuliterations</groupId> <artifactId>services</artifactId> </exclusion> </exclusions> </dependency>

These dependencies can be hard to find. Use the mvn dependency:tree command to see where things are being imported transitively. Spring Security, another library whose top level types we wanted on the CLASSPATH, also required exclusion elements because it drags in Spring core.

Some Classes - like those in JAXB - You Just Can't Avoid

Any class that's not in Android's JDK-class whitelist is not available on Android and thus renders code that depends on it incompatible. Some classes, like those in the JAXB (Java-to-XML binding) API, are hard to ignore as they're pervasive. I wanted to use the Spring HATEOAS Resource, Link, types. These types are used as representations of various entities in REST responses that are sometimes rendered as XML using JAXB, they could not be loaded in Android! So, I had to copy those types locally and mirror the package structure and remove the offending annotations. Hopefully I can clean this up going forward.

The Maven Dependency Dance with Spring Android, Spring Social and Spring Security

Roy Clarkson (@royclarkson) and I gave a talk at SpringOne2GX 2013 in which we talked about building REST services with an eye towards consuming those services on mobile platforms like Android and iOS. This talk demonstrates the progressive evolution of an application using Spring MVC, Spring HATEOAS, Spring Data REST, Spring Security, Spring Security OAuth, and Spring Android. The code's benefited from a lot of help from Rob Winch,

Layout of the Code

The code for the talk is on my GitHub account (github.com/joshlong/**the-spring-rest-stack**). Importantly, the code lives in the code directory. Beneath that there are two choices: web (where you'll find the rest, hateoas, hateoas-data, and oauth, social modules) and client (where you can load the Android module and the iOS module). The modules in the web folder in respective order, demonstrate the evolution of a simple REST service which incorporates hypermedia, Spring Data repositories and OAuth security. The social module demonstrates how to build an OAuth client that consumes the service.

Building and Editing the Code

The project is all, at the moment, Maven based, though moving to Gradle seems imminent as that is the Google-endorsed route for Android builds. I know the Android client to be importable and buildable using IntelliJ IDEA's Android support (which in theory should work in Android Studio, which is freely available).

The Dependency Dance and Android

We used up-to-date revisions of major libraries in our build file, linked for reference. Up-to-date and sometimes bleeding edge. The Android application uses the Spring Android project, which - basically - provides an API compatible implementation of the RestTemplate found in Spring core.

It does not however provide the entire framework, and if you bring in certain libraries from the core you'll get weird issues because some classes in the Spring Android modules are mostly the same in Spring Android and in the core, but they're not identical, due to the differing natures of the environments in which they run. The easiest way to ensure everything's OK is to explicitly exclude all Spring modules except the Spring Android dependencies then, selectively, re-introduce the types as you need them.

The types in the Spring Android RestTemplate module provides more than enough compatibility to let Spring Social's client machinery work unchanged on Android. This, of course, means that we can use the Spring Social-powered OAuth client in the social module in our Android application. Awesome!

For example, while I needed the Spring Social core types and implementations, I didn't need the core Spring libraries that it brought in. So, we get this rather dramatic stanza:

<dependency> <groupId>org.springframework.social</groupId> <artifactId>spring-social-core</artifactId> <version>${spring-social.version}</version> <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> </exclusion> <exclusion> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> </exclusion> <exclusion> <groupId>aopalliance</groupId> <artifactId>aopalliance</artifactId> </exclusion> <exclusion> <groupId>com.joshlong.restfuliterations</groupId> <artifactId>services</artifactId> </exclusion> </exclusions> </dependency>

These dependencies can be hard to find. Use the mvn dependency:tree command to see where things are being imported transitively. Spring Security, another library whose top level types we wanted on the CLASSPATH, also required exclusion elements because it drags in Spring core.

Some Classes - like JAXB - You Just Can't Avoid

Any class that's not in Android's JDK-class whitelist is not available on Android and thus renders code that depends on it incompatible. Some classes, like those in the JAXB module, are hard to ignore as they're pervasive. I wanted to use the Spring HATEOAS Resource, Link, types. These types are used as representations of various entities in REST responses that are sometimes rendered as XML using JAXB, they could not be loaded in Android! So, I had to copy those types locally and mirror the package structure and remove the offending annotations. Hopefully I can clean this up going forward.

Spring Tool Suite and Groovy/Grails Tool Suite 3.4.0.M1 released

Dear Spring community,

I am happy to announce the first milestone release 3.4.0.M1 of the Spring Tool Suite (STS) and the Groovy/Grails Tool Suite (GGTS).

Highlights from this milestone build include:

  • import new Getting Started guides directly into the IDE
  • new wizard to start with Spring Boot directly from within the IDE
  • automatic detection for JavaConfig classes
  • basic support for Groovy in Spring IDE
  • updated to Eclipse Kepler SR1 (RC1)
  • updated to Grails 2.2.4
  • updated to tc Server 2.9.3

Both tool suites ship on top of the latest Eclipse Kepler SR1 RC builds.

The 3.4.0. release is scheduled for early October 2013 - shortly after the Eclipse Kepler SR1 release.

To download the distributions, please go visit:

Detailed new and noteworthy notes can be found here: STS/GGTS 3.4.0.M1 New & Noteworthy.

Enjoy!

Spring Data Couchbase 1.0 M1 and Spring Data Solr 1.0 GA released

Hot on the heals of the Spring Data Babbage GA release I am happy to announce the availability of two community driven Spring Data modules, namely the first milestone of Spring Data Couchbase lead by Michael Nitschinger and the 1.0 GA of Spring Data Solr lead by Christoph Strobl.

The first milestone release of the Couchbase module contains lots of features that allow you to build content driven and scalable applications on top of Couchbase and spring-data very quickly. This release features support for templates, repositories, Java and XML-style configuration. Entities are automatically converted into JSON documents, which can be queried from Couchbase and exported through scalable map/reduce views. In addition to that, the release contains support for @Cacheable annotations, which allow you to cache any kind of binary data (for example serialized java objects) inside Couchbase in a transparent manner.

Find more on that on the project on the project website.

The Spring Data Solr GA release is also based on the latest core release in Babbage. The release concludes a trail of milestones and release candidates and finally adds these bits and pieces:

  • Boost query terms via @Boost
  • Support for @Highlight and @Facet
  • Extensible document converter
  • Enhanced multicore support

For the full release information have a look at the changelog and on the project website.

Spring Data Redis 1.1 Released

Dear Spring Community,

I am pleased to announce the SpringOne 2013 release of Spring Data Redis 1.1! This release provides support for Redis 2.6 commands and features, including an abstraction for running Redis scripts from your Spring application.

Other highlights include:

  • Significant enhancements to pipelining functionality
  • Data type conversion and deserialization of Redis transaction results
  • Modified API for adding or removing multiple List, Set, and Hash elements in one call

Run this Jira Query for a complete list of changes.

We look forward to your feedback on the forum or in the issue tracker.

This Week in Spring - September 10, 2013 - SpringOne2GX 2013 Edition

Welcome to This Week in Spring, SpringOne2GX 2013 edition!

We're now in day 2 of the SpringOne2GX 2013 conference in Santa Clara, CA! Yesterday's keynote saw a lot of new exciting new announcements and introductions and I'll discuss some of those here, and then have subsequent coverage for the balance of the week.

Here, of course, is your abridged look at all that's glitters in the Spring community and (hurrayy!!) at SpringOne2GX 2013! With no exaggeration, this is the most exciting SpringOne2GX to date.

One of the things I most like about SpringOne2GX is the access it affords attendees to the brains behind the awesome. After tonight's keynote dinner a few of the project leads lingered a few minutes and took this impromptu photo for me. Spring core lead Juergen Hoeller is front-center, in the blue shirt. For what it's worth, Juergen doesn't actually tweet (the account is a placeholder!), which makes the opportunity to chat with him at SpringOne even more amazing! Going counter-clockwise, starting after Juergen, you then have Spring Security lead Rob Winch, Spring Mobile and Spring Android lead Roy Clarkson, Reactor project lead Jon Brisbin, and Spring Social lead Craig Walls.

  1. First, we have announced a major new identity for the Pivotal Spring technology stack. Yesterday's keynote saw the unveiling of the Spring IO platform. The platform broadly describes the amazing new technologies - both libraries and runtimes - we're delivering to accommodate next generation use cases here at Pivotal, with Spring at the heart of it all! The new identity also emphasizes the Spring projects, and our position within the Pivotal family of technologies.
  2. A huge part of this is a brand new website we've just launched: Spring.IO! Spring.IO is a new website with numerous introductory guides and tutorials, much improved documentation referenceability (check out, for example, the Spring Framework project page) and a slew of other nice features. I, personally, think it looks really sharp, too! Even better? The website is written entirely in Spring, and runs on Cloud Foundry! You want more? The code will be open-sourced, and made available for all to reference in short order. (It's on the to-do list! :D) We're still migrating from the old site to the new one, so expect to see posts (like those one!) cross-posted to both for a while!)
  3. Another part of this revised change is our renamed Twitter handle (it used to be @SpringSource, and now it's @SpringCentral). Be sure to say "hi" if you're on Twitter! Also, you might follow me and Pivotal and Cloud Foundry while you're at it.
  4. Grails 2.3.0.GA has been released! I don't normally cover Grails (mainly because the Grails community does such an epic job already), but this release is a huge, featureful new release and coincident with @SpringOne2GX, and so I couldn't leave it out. As you'd expect, the Groovy and Grails communities turned out in force for the event!
  5. Spring Batch 3.0 M2 was released last night, also coincadent with SpringOne2GX 2013. The new release brings the project that much closer to fully implementing the Batch JSR, which was developed with participation from the Spring Batch team, and which the Spring Batch project will fully support when 3.0 is released. Check it out! The new release also, of course, supports the gorgeous Spring Batch Java configuration API released in Spring Batch 2.2, so it's a nice release no matter what you're doing.
  6. Spring Data lead has announced the latest release, Spring Data Babbage GA!
  7. Spring Data ninja Thomas Risberg has just announced that Spring for Hadoop 1.0.1 GA and 2.0 M1 are now available , as well.
  8. Janne Valkealahti has just announced the Spring Yarn project, which embraces the foundational runtime underneath Hadoop 2.
  9. Spring Integration and Spring AMQP lead Gary Russell has just announced Spring Integration 2.2.5 And 3.0 Milestone 3 are now available.
  10. Julien Dubois did a write-up of the SpringOne2GX day 1 keynote (in French). The post is titled, "Spring Day 1: the return of Spring". Definitely a good read!
  11. Pivotal CEO Paul Maritz did an interesting interview with InfoWorld. Check it out. Paul was the lead keynote for the Cloud Foundry Platform conference event (which lead into SpringOne2GX over the weekend) and the SpringOne2GX keynote yesterday, BTW.
  12. Finally, be sure to follow me and @SpringCentral for the latest and greatest as it happens at SpringOne2GX!

This Week in Spring - September 10, 2013 - SpringOne2GX 2013 Edition

Welcome to This Week in Spring, SpringOne2GX 2013 edition!

We're now in day 2 of the SpringOne2GX 2013 conference in Santa Clara, CA! Yesterday's keynote saw a lot of new exciting new announcements and introductions and I'll discuss some of those here, and then have subsequent coverage for the balance of the week.

Here, of course, is your abridged look at all that's glitters in the Spring community and (hurrayy!!) at SpringOne2GX 2013! With no exaggeration, this is the most exciting SpringOne2GX to date.

One of the things I most like about SpringOne2GX is the access it affords attendees to the brains behind the awesome. After tonight's keynote dinner a few of the project leads lingered a few minutes and took this impromptu photo for me. Spring core lead Juergen Hoeller is front-center, in the blue shirt. For what it's worth, Juergen doesn't actually tweet (the account is a placeholder!), which makes the opportunity to chat with him at SpringOne even more amazing! Going counter-clockwise, starting after Juergen, you then have Spring Security lead Rob Winch, Spring Mobile and Spring Android lead Roy Clarkson, Reactor project lead Jon Brisbin, and Spring Social lead Craig Walls.

  1. First, we have announced a major new identity for the Pivotal Spring technology stack. Yesterday's keynote saw the unveiling of the Spring IO platform. The platform broadly describes the amazing new technologies - both libraries and runtimes - we're delivering to accommodate next generation use cases here at Pivotal, with Spring at the heart of it all! The new identity also emphasizes the Spring projects, and our position within the Pivotal family of technologies.
  2. A huge part of this is a brand new website we've just launched: Spring.IO! Spring.IO is a new website with numerous introductory guides and tutorials, much improved documentation referenceability (check out, for example, the Spring Framework project page) and a slew of other nice features. I, personally, think it looks really sharp, too! Even better? The website is written entirely in Spring, and runs on Cloud Foundry! You want more? The code will be open-sourced, and made available for all to reference in short order. (It's on the to-do list! :D) We're still migrating from the old site to the new one, so expect to see posts (like those one!) cross-posted to both for a while!)
  3. Another part of this revised change is our renamed Twitter handle (it used to be @SpringSource, and now it's @SpringCentral). Be sure to say "hi" if you're on Twitter! Also, you might follow me and Pivotal and Cloud Foundry while you're at it.
  4. Grails 2.3.0.GA has been released! I don't normally cover Grails (mainly because the Grails community does such an epic job already), but this release is a huge, featureful new release and coincident with @SpringOne2GX, and so I couldn't leave it out. As you'd expect, the Groovy and Grails communities turned out in force for the event!
  5. Spring Batch 3.0 M2 was released last night, also coincadent with SpringOne2GX 2013. The new release brings the project that much closer to fully implementing the Batch JSR, which was developed with participation from the Spring Batch team, and which the Spring Batch project will fully support when 3.0 is released. Check it out! The new release also, of course, supports the gorgeous Spring Batch Java configuration API released in Spring Batch 2.2, so it's a nice release no matter what you're doing.
  6. Spring Data lead has announced the latest release, Spring Data Babbage GA!
  7. Spring Data ninja Thomas Risberg has just announced that Spring for Hadoop 1.0.1 GA and 2.0 M1 are now available , as well.
  8. Janne Valkealahti has just announced the Spring Yarn project, which embraces the foundational runtime underneath Hadoop 2.
  9. Spring Integration and Spring AMQP lead Gary Russell has just announced Spring Integration 2.2.5 And 3.0 Milestone 3 are now available.
  10. Julien Dubois did a write-up of the SpringOne2GX day 1 keynote (in French). The post is titled, "Spring Day 1: the return of Spring". Definitely a good read!
  11. Pivotal CEO Paul Maritz did an interesting interview with InfoWorld. Check it out. Paul was the lead keynote for the Cloud Foundry Platform conference event (which lead into SpringOne2GX over the weekend) and the SpringOne2GX keynote yesterday, BTW.
  12. Finally, be sure to follow me and @SpringCentral for the latest and greatest as it happens at SpringOne2GX!

Introducing the Spring YARN framework for developing Apache Hadoop YARN applications

We're super excited to let the cat out of the bag and release support for writing YARN based applications as part of the Spring for Apache Hadoop 2.0 M1 release. In this blog post I’ll introduce you to YARN, what you can do with it, and how Spring simplifies the development of YARN based applications.

If you have been following the Hadoop community over the past year or two, you’ve probably seen a lot of discussions around YARN and the next version of Hadoop's MapReduce called MapReduce v2. YARN (Yet Another Resource Negotiator) is a component of the MapReduce project created to overcome some performance issues in Hadoop's original design. The fundamental idea of MapReduce v2 is to split the functionalities of the JobTracker, Resource Management and Job Scheduling/Monitoring, into separate daemons. The idea is to have a global Resource Manager (RM) and a per-application Application Master (AM). A generic diagram for YARN component dependencies can be found from YARN architecture.

MapReduce Version 2 is an application running on top of YARN. It is also possible to make similar custom YARN based application which have nothing to do with MapReduce, it is simply running YARN application. However, writing a custom YARN based application is difficult. The YARN APIs are low-level infrastructure APIs and not developer APIs. Take a look at the documentation for writing a YARN application to get an idea of what is involved.

Starting with the 2.0 version, Spring for Apache Hadoop introduces the Spring YARN sub-project to provide support for building Spring based YARN applications. This support for YARN steps in by trying to make development easier. “Spring handles the infrastructure so you can focus on your application” applies to writing Hadoop applications as well as other types of Java applications. Spring’s YARN support also makes it easier to test your YARN application.

With Spring’s YARN support, you're going to use all familiar concepts of Spring Framework itself, including configuration and generally speaking what you can do in your application. At a high level, Spring YARN provides three different components, YarnClient, YarnAppmaster and YarnContainer which together can be called a Spring YARN Application. We provide default implementations for all components while still giving the end user an option to customize as much as he or she wants. Lets take a quick look at a very simplistic Spring YARN application which runs some custom code in a Hadoop cluster.

The YarnClient is used to communicate with YARN's Resource Manager. This provides management actions like submitting new application instances, listing applications and killing running applications. When submitting applications from the YarnClient, the main concerns relate to how the Application Master is configured and launched. Both the YarnAppmaster and YarnContainer share the same common launch context config logic so you'll see a lot of similarities in YarnClient and YarnAppmaster configuration. Similar to how the YarnClient will define the launch context for the YarnAppmaster, the YarnAppmaster defines the launch context for the YarnContainer. The Launch context defines the commands to start the container, localized files, command line parameters, environment variables and resource limits(memory, cpu).

The YarnContainer is a worker that does the heavy lifting of what a YARN application will actually do. The YarnAppmaster is communicating with YARN Resource Manager and starts and stops YarnContainers accordingly.

You can create a Spring application that launches an ApplicationMaster by using the YARN XML namespace to define a Spring Application Context. Context configuration for YarnClient defines the launch context for YarnAppmaster. This includes resources and libraries needed by YarnAppmaster and its environment settings. An example of this is shown below.

<yarn:configuration /> <yarn:localresources> <yarn:hdfs path="/path/to/my/libs/*.jar"/> </yarn:localresources> <yarn:environment> <yarn:classpath/> </yarn:environment> <yarn:client app-name="my-yarn-app"> <yarn:master-runner /> </yarn:client>

Note: Future releases will provide a Java based API for configuration, similar to what is done in Spring Security 3.2.

The purpose of YarnAppmaster is to control the instance of a running application. The YarnAppmaster is responsible for controlling the lifecycle of all its YarnContainers, the whole running application after the application is submitted, as well as itself.

<yarn:configuration /> <yarn:localresources> <yarn:hdfs path="/path/to/my/libs/*.jar"/> </yarn:localresources> <yarn:environment> <yarn:classpath/> </yarn:environment> <yarn:master> <yarn:container-allocator/> <yarn:container-runner/> </yarn:master>

The example above is defining a context configuration for the YarnAppmaster. Similar to what we saw in YarnClient configuration, we define local resources for the YarnContainer and its environment. The classpath setting picks up hadoop jars as well as your own application jars in default locations, change the setting if you want to use non-default directories. Also within the YarnAppmaster we define components handling the container allocation and bootstrapping. Allocator component is interacting with YARN resource manager handling the resource scheduling. Runner component is responsible for bootstrapping of allocated containers.

<yarn:container container-class="org.example.MyCustomYarnContainer"/>

Above example defines a simple YarnContainer context configuration.

To implement the functionality of the container, you implement the interface YarnContainer. The YarnContainer interface is similar to Java’s Runnable interface, its has a run() method, as well as two additional methods related to getting environment and command line information.

Below is a simple hello world application that will be run inside of a YARN container:

public class MyCustomYarnContainer implements YarnContainer { private static final Log log = LogFactory.getLog(MyCustomYarnContainer.class); @Override public void run() { log.info("Hello from MyCustomYarnContainer"); } @Override public void setEnvironment(Map<String, String> environment) {} @Override public void setParameters(Properties parameters) {} }

We just showed the configuration of a Spring YARN Application and the core application logic so what remains is how to bootstrap the application to run inside the Hadoop cluster. The utility class, CommandLineClientRunner provides this functionality.

You can you use CommandLineClientRunner either manually from a command line or use it from your own code.

# java -cp <mile long classpath> org.springframework.yarn.client.CommandLineClientRunner application-context.xml yarnClient -submit

A Spring YARN Application is packaged into a jar file which then can be transferred into HDFS with the rest of the dependencies. A YarnClient can transfer all needed libraries into HDFS during the application submit process but generally speaking it is more advisable to do this manually in order to avoid unnecessary network I/O. Your application wont change until new version is created so it can be copied into HDFS prior the first application submit. You can i.e. use Hadoop's hdfs dfs -copyFromLocal command.

Below you can see an example of a typical project setup.

src/main/java/org/example/MyCustomYarnContainer.java src/main/resources/application-context.xml src/main/resources/appmaster-context.xml src/main/resources/container-context.xml

As a wild guess, we'll make a bet that you have now figured out that you are not actually configuring YARN, instead you are configuring Spring Application Contexts for all three components, YarnClient, YarnAppmaster and YarnContainer.

We have just scratched the surface of what we can do with Spring YARN. While we’re preparing more blog posts, go ahead and check existing samples in GitHub. Basically, to reflect the concepts we described in this blog post, see the multi-context example in our samples repository.

Future blog posts will cover topics like Unit Testing and more advanced YARN application development.

Spring Data Babbage release train goes GA

Dear Spring community, just in time for SpringOne 2013, we are happy to announce the availability of the GA version of the Spring Data release train code named Babbage. The release concludes the development of a pile of new features and improvements for the Spring Data Core, JPA, MongoDB and Neo4j modules and will serve as foundation for upcoming releases of a bunch of community modules. Here are the most important features of the release.

General upgrades / Spring Data Commons:
  • Spring 4 and JDK 8 compatibility improvements in Spring Data Core to leak into all modules
  • Extended Pageable/Page APIs
  • Advanced web and hypermedia integration for Spring MVC
  • Support for count…By in derived query method names of repositories
  • Upgrade to Querydsl 3.x timeline
  • Improved CDI extensions for all modules
Spring Data JPA
  • Support for SpEL expressions in manually defined queries
  • Support for TemporalType on query parameter binding
Spring Data MongoDB
  • Support for the MongoDB aggregation framework
  • FieldNamingStrategy with a turn-key option for camel case abbreviation
Spring Data Neo4j
  • Upgrade to latest version of Neo4j
  • Performance improvements in the persistence metadata subsystem

For more information about the release content, have a look at the Babbage wiki page or the run the JIRA query listing all of the over 200 tickets fixed in this release train.

This release concludes the work of the last 6 month and we're especially happy about the increased amount of community contributions that made it into the release train. The train will be part of the upcoming, orchestrated Spring IO platform release and serve as a foundation for the upcoming releases of the Spring Data community modules for Solr, Couchbase and Elasticsearch.

SpringSource Training Schedule: October 2013

If you are a Java developer looking to increase your Spring knowledge, Spring Training by Pivotal is the place to start. We are providing several Spring trainings across the globe closely connected to your needs as a professional developer. This week we are at SpringOne 2GX, make sure to visit the Spring Education booth to score an 8GB USB, a Spring beer mug and more great stuff.

The complete Spring training schedule for September, 2013 can be found below:

Step 1: Core Spring

Americas

Asia Pacific

Europe, Middle East & Africa

Step 2: Spring Web / Enterprise Integration with Spring / Hibernate with Spring

Americas

Europe, Middle East & Africa

If you cannot find a professional training near you, you can always request an onsite SpringSource training

Spring for Apache Hadoop 1.0.1 GA and 2.0 M1 released

Spring for Apache Hadoop 1.0.1 GA – adding support for Hadoop version 2

We are happy to announce a new 1.0.1 GA release of the Spring for Apache Hadoop project. This release introduces support for Apache Hadoop 1.2.1, Apache Hadoop 2.0.6-alpha, Apache Hadoop 2.1.0-beta as well as support for the most recent versions of the major commercial distributions - Hortonworks, Cloudera and Pivotal.

The default version is the current Apache Hadoop stable release 1.2.1 and this is the base for the transitive dependency graph for the 1.0.1.RELEASE version.

To make it easier to configure project builds using other versions or distributions we are introducing specific “flavors” of the Maven artifacts and POMs with their respective transitive dependencies. For this 1.0.1 GA release we are publishing four additional artifact versions -- 1.0.1.RELEASE-cdh4 (Cloudera CDH 4.3.1), 1.0.1.RELEASE-hdp13 (Hortonworks HDP 1.3), 1.0.1.RELEASE-phd1 (Pivotal HD 1.0) and 1.0.1.RELEASE-hadoop21 (Apache Hadoop 2.1.0-beta). By using these versions as your dependency you will be pulling in their respective transitive dependencies of each distribution.

The 1.0.1.RELEASE version is available from Maven Central while the version/distribution specific artifacts are available from the SpringSource Release Repository.

We continue to maintain support for older versions like Apache Hadoop 1.0.4 and Cloudera CDH 3 but we don't publish artifacts based on them.

Downloads | JavaDocs | Reference Documentation | Changelog

Spring for Apache Hadoop 2.0 M1 – adding support for Hadoop version 2 and YARN

We are also happy to announce the first milestone release of the new Spring for Apache Hadoop 2.0 project. This is the first release that includes the new support for Hadoop YARN. It maintains the existing support from the 1.0.x versions of the Spring for Apache Hadoop project but we have made some major refactoring to be able to support new developments primarily for the YARN support.

We have broken the project code into separate sub-projects: Core M/R, FSShell, Hive, Pig etc. and basic configuration Batch is separate with separate namespace Cascading is also separate with separate namespace Test sub-project for integration testing Adding spring-yarn sub-project active for Apache Hadoop version 2 based builds

This is the first milestone release and we encourage users to kick the tires and provide feedback and suggestions. There will be more in-depth coverage of the new YARN features in an upcoming blog post and at the SpringOne2GX conference next week in the session Getting started with Spring Data and Apache Hadoop presented by Thomas Risberg and Janne Valkealahti.

The release artifacts for the 2.0.0.M1 version are available from the SpringSource Milestone Repository.

Downloads | JavaDocs | Reference Documentation | Changelog

For more information on Spring for Apache Hadoop, see the project home page for reference documentation and the sample applications.

We look forward to your feedback on the forum or in the issue tracker.

Spring Integration 2.2.5 and 3.0 Milestone 3 Are Now Available

We are pleased to announce that the final milestone for Spring Integration (3.0.0.M3) is now available.

The 3.0.0.M3 Release Notes list the features and issues resolved since milestone 2.

See also the What's New for a list of the important changes in the 3.0 release.

The artifacts are available now in the repo.springsource.org milestone repository.

In addition, we are pleased to announce that the 2.2.5.RELEASE is also available, resolving the issues described in its release notes.

See the Project Page for more information, and links to downloads, documentation etc.

The artifacts are available now in the repo.springsource.org release repository and will be in maven central within a few hours.

This Week in Spring - Sept 3rd, 2013

Welcome to This Week in Spring! SpringOne is almost upon us! It kicks off this weekend with the Cloud Foundry Platform event and continues on until next Thursday. I, personally, am very excited (and a bit nervous!) about this year's show. It's going to be so epic. Yesterday may have been a holiday here in the US (I hope you all enjoyed a wonderful holiday!), but most of us on the Spring team were working fast and furiously in preparation for SpringOne2GX!

My Road to SpringOne2GX 2013 the SpringOne2GX 2013 agenda looks soo good! I'm into a lot of different things like the open web (REST-powered architectures), big data, the cloud, and security and - at SpringOne - there's no reason I can't get my fill of each topic! Here are just some of the talks that I would love to see when I'm there.

  • Tackling Big Data Complexity with Spring with Mark Fisher and Mark Pollack. Does this one need any introduction? Spring XD leads Mark Pollack (Spring core contributor, Spring AMQP co-founder, Spring.NET founder, Spring Data and Spring Data for Hadoop lead) and Mark Fisher (Spring core contributor, Spring Integration founder, Spring AMQP co-founder) will introduce Spring XD, the most powerful way to build big data-centric applications today.
  • Build Your Very Own Private Cloud Foundry with the amazing Matt Stine. Matt's going to introduce how to setup your own on-premises Cloud Foundry instance using BOSH. Matt's a great speaker, a fantastic technologist, and I can't wait to see this talk.
  • Distributed rules engines and CEP with John Davies. John's the CEO of C24, and has got some incredible enterprise integration war-stories. The man's an epic speaker, too.
  • RabbitMQ is the new King with Jan Machacek and RabbitMQ Developer Advocate Alvaro Videla. Jan's a longtime Spring-guru and distributed systems guy, and Alvaro's the Pivotal RabbitMQ developer advocate (in the same way that I'm the Pivotal Spring developer advocate…). They're both sensational and I expect this one will be a wonderful talk.
  • Your Data, Your Search, Elasticsearch with Costin Leau. Costin worked on, among many things, the original Spring Cache integration with Spring core, Spring Data GemFire, Spring Data itself, the OSGi support in Spring DM server (years ago), and a lot more. He's now working with Elasticsearch, and I can't wait to hear his perspective. Costin's really good at taking complex topics and distilling their essences.

I have four presentations (with amazing co-presenters!) this year. Andy Piper and I will present on building Spring and Cloud Foundry-powered applications. Roy Clarkson and I will present on using Spring and REST to connect applications, Kevin Nilson and I will present on using Spring and profiles to build applications that adapt and Phil Webb and I will present on how to improve your Java configuration muscle memory.

I look forward to seeing you guys at SpringOne2GX! Ping me on Twitter (@starbuxman) if you're around and let's talk Spring!

And now, on to this Week's Roundup! Hopefully, this will sate your appetites until SpringOne2GX! :)

  1. Spring Scala lead Arjen Poutsma has just released Spring Scala 1.0.0.RC1. The new release is the first release candidate in the release cycle, towards a 1.0 release, so definitely check it out!
  2. Join our friends from Pivotal Labs as David Frank shows you How to Get Agile with Pivotal Tracker, on September 5th.
  3. Join Phil Webb as he dives into the one of the newest, hottest projects in Spring - Spring Boot on September 26th.
  4. Jan Stenberg put together a nice post on Russ Miles' Life Preserver pattern as used with Spring. The post is a little light on code, but you can check out the original presentation to get the details!
  5. The JavaBeat blog has a really detailed post on how to use Spring's @Tranactional annotation.
  6. Eugen Dvorkin has a nice post on how to use Storm, Groovy, a CEP engine and Spring together. This is really cool, although there's not a lot of code. I also wonder if this could've been done in a simpler way using Spring XD, though.
  7. Spring web-ninja Arjen Poutsma, and author of the original RestTemplate, has been hard at work on an asynchronous RestTemplate to be included in Spring 4. Looking awesome.
  8. Luis Miguel Gracia Luis has put together a nice post that introduces some of the great new stuff coming for Spring developers since the Spring team became part of Pivotal, including Spring XD, Spring Boot, Spring Loaded and Spring REST Shell. The post is Spanish language, but Google Translate does a fairly good job.
  9. Rajkumar Singh has put together a nice post - Apache Hadoop and Spring Data : Configuring mapreduce Job - that introduces Spring for Apache Hadoop. Great post!
  10. The Bluesoft blog has the second post in a series on using Angular.js with Spring MVC to build a login dialog. This is getting good…
  11. The Technicalpractical blog has a post, Display Model As JSON or XML using Spring. The post does a fine job introducing how to put together a JSON view using Spring MVC 2.5-era APIs, but I hope you'll check out some more recent introductions to building JSON-centric REST services with Spring. Here's a (much) simpler example.

Pages