What's New in Spring Integration 2.2 (Part 4 - Retry and More)

Engineering | Gary Russell | October 09, 2012 | ...

Introduction

This is the fourth part in a series of blog posts highlighting some of the new features available in Spring Integration 2.2 following the recent release of Release Candidate 1. The first part talks about the MongoDB adapters, the second part talks about transaction synchronization; the third part talks about JPA support.

Spring Integration 2.2 introduces the ability to apply one or more localized AOP Advice elements to a message handler. A number of standard Advice classes has also been provided as well as a sample application that explores the features they provide.

Background

For a general introduction to Aspect Oriented Programming (AOP), see the Spring Documentation

With Spring Integration, to-date, it has been possible to apply an <advice-chain/> to a poller. Assuming Direct channels are being used, an AOP Advice in such a chain applies to the entire flow, encompassing all downstream components. There are times, however, when it would be advantageous to advise just an individual endpoint to, say, retry an…

What's New in Spring Integration 2.2 (Part 3 – JPA Support)

Engineering | Gunnar Hillert | October 05, 2012 | ...

This is the third part in a series of blog posts highlighting some of the new features available in Spring Integration 2.2 following the recent release of Release Candidate 1. The first part described the new set of MongoDB adapters. In part two we highlighted the new extended support for synchronizing non-transactional resources with transactions.

In this third part today, we would like to introduce the new Java Persistence API (JPA) support that is provided starting with Spring Integration 2.2. The JPA module is persistence-provider-agnostic and has been tested using:

As part of the new JPA module, we provide several components for retrieving and persisting JPA entity objects:
  • JPA Inbound Channel Adapter
  • JPA Outbound Channel Adapter
  • JPA Updating Outbound Gateway
  • JPA Retrieving Outbound Gateway
Using these components, you can select, create, update and delete entities in your database. Besides persisting data using the entity classes directly, you can also execute queries using the Java Persistence Query Language (JPQL) as well as using native SQL queries. Additionally, named queries are supported as well.

The JPA Sample

In our Spring Integration Samples repository, we provide a sample application demonstrating the JPA support, which we want to use in this blog post to show you how to easily get started.

The provided sample is using an embedded H2 database which contains a single table called PEOPLE. This table is mapped to the Person entity class in package org.springframework.integration.samples.jpa

Spring Remains at the Forefront of Enterprise Java: BigData, NoSQL, and Cloud Portability

Engineering | Adrian Colyer | October 01, 2012 | ...

It’s JavaOne time again and this year you’ll find sessions on how Spring works with Java SE to address Big Data, NoSQL, and enterprise integration challenges. We’ve always worked hard to ensure that Spring remains at the forefront of enterprise Java by providing timely support for emerging trends and technologies. The numbers suggest that our users appreciate this. A recent report from Evans Data ("Spring Source Usage Study," Evans Data Corporation, September 2011) shows:

  • Spring is the framework of choice among expert Java developers. More than two thirds of Java developers are either using Spring today or planning to do so
  • Spring usage continues to grow. More than half of existing Spring users expect to grow or significantly grow their use of Spring.
  • Spring is delivering results. 70% of Spring users indicate at least a 50% productivity gain by using Spring and 73% indicate at least a 50% time reduction to deliver a completed project.
  • Spring users are at the forefront of enterprise Java. Spring users are more cloud ready, and Spring adopters are more likely to have already deployed applications to the cloud.

Spring has always offered deployment flexibility. In the early days this meant a choice of application servers, but now this extends to choice of cloud platforms including our own Cloud Foundry. Spring has always provided strong data access support. In the early days this meant a choice of approaches for accessing a relational database, today this extends to a range of Big Data and NoSQL stores, data processing, and in-memory data grid capabilities. Spring has always valued developer productivity and provided first class support for writing server-side web applications. Today this extends to meet the modern requirements of HATEOAS-based REST APIs.

These are real and pressing concerns within the enterprise today. Cloud is everywhere, and now Big Data is firmly on the enterprise project radar too, creating a range of new requirements:

  • Big Data: the need to store and get analytics from gigabytes, terabytes or petabytes of unstructured or semi-structured data
  • Fast Data: the increasing need for low latency interactions with large sets of data, often driven by today’s mobile and social apps
  • Flexible Data: the need to adapt data access to the most appropriate model for each application
  • Cloud Delivery: the growing demand to access data as a service, provisioned on the cloud of your choice.

The latest Harvard Business Review survey indicates that 85% of organizations have Big Data initiatives planned or in progress. Application developers need to deliver capable, high quality solutions that integrate with this new world and can be deployed anywhere, on or off premise. NoSQL and NewSQL are also being used to address a wide range of use cases including:

  • Managing large data streams of non-transactional data (logs, clickstreams)
  • Fraud detection
  • Timelines (a la Twitter)
  • Synching offline and online data
  • Online gaming
  • Document, catalog and content management
  • Archiving - storing a large continual stream of data that is still accessible on-line
  • Embedded systems (small footprint databases in devices)

See this High Scalability blog entry for more details.

451 Research’s recent survey data highlights the changing shape of the data landscape. One size no longer fits all.

Enterprise developers can start taking advantage of these new technologies today with Spring and the familiar Spring programming model. Spring offers:

The thriving open source community around NoSQL, together with Spring, makes developing for the next generation of data stores and data processing more productive today. We don’t provide a single Java API for all persistence stores; this is not realistic given the fundamental differences between them. But we do provide a common and familiar programming model based on the concepts of templates and, where available, repositories. See Tobias Trelle’s recent InfoQ article for more details.

All in all, JavaOne 2012 is sure to be an action packed week, full of great Java tech talks, keynotes, and sessions including coverage of our own Big Data, NoSQL, and integration initiatives. Developers who want to get hands on with these technologies now also won't want to miss SpringOne 2GX in Washington DC October 15-18, 2012. We have a packed technical agenda covering all aspects of modern enterprise application development.

This Week in Spring - 25th September, 2012

Engineering | Josh Long | September 26, 2012 | ...

Welcome back to another installment of This Week in Spring! There's so much good stuff to look at this week. Can you believe we're already staring down October?

It's time to think about who or what you are going to be for halloween!

With October comes SpringOne2GX, the premier event for Spring developers. Check out the final schedule of speakers and sessions for this year's event! SpringOne 2GX is your opportunity to learn from development leads and published authors on the Spring, Groovy/Grails, Tomcat and Cloud technologies.

  1. The video from Spring Security lead Rob Winch's webinar introducing Spring Security is now available.
  2. Oleg Zhurakousky kicks off the march to Spring Integration 2.2 with a blog introducing the new MongoDB features in 2.2.
  3. Gary Russell has announced release candidate 1 of Spring Integration 2.2.
          This is intended to be the final release before GA, so users are encouraged to give feedback on this release.  
    
    </LI>
    
  4. Costin Leau has announced the 1.0.0.RC1 release of Spring Shell, which is an extraction of the shell used in Spring Roo and made available through the Spring programming model.
       </LI>
    
  5. Roger Hughes is back at it again, this time with a look at Spring 3.1 caching and configuration options, specifically focusing on setting up a CacheManager.
  6. The vFabric blog has an interesting look at the "split-agent" architecture behind Spring Insight, that allows the separation of the collection stage from the analysis one.
  7. Krishna Prasad has a nice post on obtaining test coverage information for Spring Web Flow applications.
  8. Mattias Severson has a nice post on handling errors in Spring MVC-based RESTful application.
  9. Ronillo Ang's put together a very brief deck on the fundamental pieces of a Spring MVC application.
  10. The JavaCode Geeks blog has a nice post on writing persistence layers with the Spring framework.
  11. L'Artech blog has a cool post on creating the login form for a web application using Spring MVC, in part 3 of a series.

What's New in Spring Integration 2.2 (Part 2 - Transaction Synchronization)

Engineering | Gary Russell | September 26, 2012 | ...

Introduction

This is the second part in a series of blog posts highlighting some of the new features available in Spring Integration 2.2 following the recent release of Release Candidate 1. The first part talks about the MongoDB adapters.

Spring Integration 2.2 introduces extended support for synchronizing non-transactional resources with transactions.

Background

Spring has provided first class support for synchronizing resources with transactions for many years. In many cases, this facility is used to synchronize transactions managed by multiple transaction managers, in order to implement the 'Best Efforts 1PC' pattern described in Dave Syer's excellent JavaWorld article.

It is often used, for example, to synchronize a JMS commit with a JDBC commit.

Spring Integration has long supported this feature, by defining a <transactional/> element on a poller. This release takes this feature one step further, by allowing synchronization of non-transactional resources with a transaction.

For example, consider a <file:inbound-channel-adapter/> and an Integration application that reads a file when it appears in a directory, and updates a database. This…

What's New in Spring Integration 2.2.RC1 (Part 1 - MongoDb)

Engineering | Oleg Zhurakousky | September 24, 2012 | ...

Introduction

Spring Integration 2.2.RC1 is out and we will be coming out with a set of blogs in the coming days discussing some of its new features. In this first blog we'll talk about MongoDb Inbound and Outbound Channel Adapters. Full set of discussed samples is available here

MongoDb Outbound Channel Adapter

MongoDb Outbound Channel Adapter allows you to write the Message payload to a MongoDb document store.

You can see the simplest configuration of the MongoDb Channel Adapter below:

<int-mongodb:outbound-channel-adapter id="deafultAdapter"/>

It will be initialized with the default instance of the MongoDbFactory (the default bean name is 'mongoDbFactory') otherwise you can provide its reference via mongodb-factory attribute.

Now you can run the MongoDbOutboundAdapterDemo. After running it open terminal window and start MongoDb CLI

$> mongo

Once in MongoDb CLI type a query:

> db.data.find({})

And you should see the 3 document entries we just created:

{ "_id" : ObjectId("505ff83d03649ed6881d…

This Week in Spring - 18th September, 2012

Engineering | Josh Long | September 19, 2012 | ...

Welcome to another installation of This Week in Spring! This week I'm in Bloomington-Normal, Illinois talking to StateFarm about Spring Projects: MVC, REST, Mobile, and Android. The developers here are code ninjas. Listening to their internal talks over the course of the day has been eye opening, to say the least. Don't miss the Spring, Groovy and Grails event of the year in Washington, DC: SpringOne2GX. If you haven't already registered, now's the time! Oh, and don't forget, if you're in the United States, today is national cheeseburger day! So... bon appetit!

    <LI> Chris Beams has announced the availability of <a href ="http://www.springsource.org/node/3654">Spring Framework 3.2 M2</a>, which features many new features including improved <CODE>TestContext</CODE> support, Spring MVC improvements, asynchronous <CODE>@Controllers</CODE>, and lots of bug-fixes and improvements.  </LI>
    <LI> This month's SpringSource webinar is coming fast - <a href ="http://www.springsource.org/node/3653"> Spring Security with Rob Winch</a>. Be sure to register now! </LI>
    <li> Martin Lippert has announced the availability  of the <a href="http://www.springsource.org…

This Week in Spring - September 11, 2012

Engineering | Josh Long | September 11, 2012 | ...


Welcome to another installation of This Week in Spring! I'm off to Oslo, Norway for the JavaZone conference to talk to people about using Spring Integration and Spring Batch on top of Cloud Foundry. Again, this is a natural use case: Cloud Foundry makes it easy to scale to handle the largest workloads, and Spring Integration and Spring Batch, presumably sitting on top of RabbitMQ, take care of the plumbing and do the heavy lifting of workload distribution across the cluster.

 <P>Wrapping up from last week's Cloud Foundry   Open Tour - India, touring <a href="http://opentour.cloudfoundry…

This Week in Spring - August 28th, 2012

Engineering | Josh Long | August 29, 2012 | ...

Welcome back to another installment of This Week in Spring, VMWorld edition! We're at the VMWorld event, talking to developers about Spring and Cloud Foundry. There's been a lot of exciting news coming out of this event, including some interesting updates around vFabric and updates regarding the timelines for Cloud Foundry itself: CloudFoundry.com, the hosted PaaS from VMware, will be GA by end-of-year, and next year will see the availability of a private on-premise Cloud Foundry. Both vFabric and Cloud Foundry are ideal environments for your Spring applications, and it's nice to see these platforms evolve.

  1. Oliver Gierke has announced that the Spring Data Release Train has reached the station! This release is an umbrella release of several projects that provides uniformity across the various modules.
    	This release includes Spring Data Commons 1.4.0.RC1, Spring Data JPA 1.2.0.RC1, 
    	Spring Data MongoDB 1.1.0.RC1, Spring Data Neo4j 2.1.0.RC3 and Spring Data Gemfire 1.2.0.RC1.
    	
    	
    	  </LI>
    <LI> Gunnar Hillert has a nice blog introducing how to <a href = "http://blog.springsource.org/2012/08/23/spring-integration-extensions/">bootstrap custom Spring Integration adapter development.</a>
    	 
    	 </LI>
    
    <LI>  Gary Russel has announced that the latest iteration of  <a href  = "http://www.springsource.org/node/3639">Spring Integration, 2.2.0M4, is now available</a>.  Gary, a very busy man indeed…

Integrating Spring MVC with jQuery for validation rules

Engineering | Michael Isvy | August 29, 2012 | ...

I was thrilled to see in a recent survey from zeroturnaround that Spring MVC was voted the most popular web framework for Java.

This framework is very flexible and there are dozens of ways to use it. As with all flexible frameworks that have many options, it is important to discuss common practices.

The project I have created for this blog entry uses features common in many Spring MVC applications. You will find something like this:

In controllers you will find typical Spring MVC features for mapping requests, extracting request data through annotations, data binding, file upload…

On the…

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