We're pleased to an announce the GA release of Spring Security 3.1.4
The release is available from the Spring Community Downloads area and jars are available from Maven central repository. See the project website for more information.
This is a maintenance release with a number of bug fixes including OSGi support for Spring 3.2.
Welcome back to another installment of This Week in Spring!
Here in San Francisco, we're experiencing the first fits of life and beautiful weather typical of spring time. Fitting, too, as things are busy-as-can-be in the Pivotal open source communities - including Cloud Foundry and SpringSource - as we march towards the Pivotal Initiative launch on April 24th. See you then!
Without further ado, let's get into this week's roundup:
Have you guys seen the amazing Java configuration support in Spring Batch 2.2.0.RC1? The code I've just linked you to demonstrates a complete working Spring Batch job that reads in a .csv file and then writes the records to a data source, all of which are configured in the class, entirely in Java. This demonstrates the @EnableBatchProcessing annotation in 2.2.0. Check it out!
Spring HATEOAS lead Oliver Gierke tweeted a link to this post, "How I Explained REST to my wife", which would seem at first to be just one person's attempt at explaining a fairly deep technology concept to a person who didn't have the same technical background, but quickly turns into a (I think really insightful) look at the applicability of REST. Check out Spring HATEOAS if you want to take your REST-fu to the next level.
I'm personally enamored of the new Java configuration APIs, both those recently released and those currently available in preview releases. I showed a very simple example of the Spring Batch API above. I also took a moment last week to write about the powerful Spring Social Java configuration API soon to be available in the 1.1.0.M2 release.
You can have Spring perform a sort of pre-condition check by using the @Required annotation to insist at runtime that a property be satisfied with a non-null value, or Spring will abort the construction of the object. This helps avoid any silent NullPointerExceptions. This JavaBeat post does a nice job explaining how to use @Required.
Implementing Domain-Driven Design with Spring and vFabric
Sponsored by EMC Consulting, this presentation highlights the use of Domain-Driven Design in a cloud-based, distributed architecture. There are several working examples of highly scalable DDD models featuring the NYSE Nanotrader system.
NanoTrader is a VMWare working reference implementation featuring SpringSource best-practices throughout the application stack. The functioning high-performance trading application includes Spring MVC with both web and mobile UI’s, Spring Integration, RabbitMQ, GemFire, Hibernate using SQLFire and/or Postgres. Domain-Driven Design (DDD) is a set of software development tools and best practices for crafting a business strategic initiative in a core domain model. How does NanoTrader apply DDD? This powerful approach to modeling a trading system will be showcased from the DDD strategic and tactical modeling perspectives.
About the speakers
Vaughn Vernon is the author of the book Implementing Domain-Driven Design, published by Addison-Wesley. Vaughn is a veteran software craftsman with more than 25 years of experience in software design, development, and architecture. Vaughn is a thought leader in simplifying software design and implementation using innovative methods. Vaughn has been programming with object-oriented languages since the 1980s and applying the tenets of Domain-Driven Design since his Smalltalk domain modeling days in the early 1990s. His experience spans a wide range of business domains. He has also succeeded in technical endeavors creating reusable frameworks, libraries, and implementation acceleration tools.
Vaughn consults and speaks internationally, and has taught his Implementing Domain-Driven Design Workshop on multiple continents. He teaches both public and private classes and workshops, and has presented at conferences such as: SpringOne 2gx; PulsoConf in Bogota, Colombia; QCon; UberConf; IASA ITARC. As an author, Vaughn has contributed to industry literature and software patterns and is a founder of the DDD Denver Meetup group.
Wes Williams is a Senior Consultant with EMC specializing in vFabric technologies and Domain-Driven Design.
He has extensive experience (25+ years) as a hands-on software developer, architect and designer supporting the creation of enterprise-class information technology systems in a wide variety of industries from small businesses to Fortune 10 companies using big, fast data. He is certified with both Microsoft and Java technologies, including certifications with Java architecture and enterprise architecture. He was formerly a guest instructor for Architecture at Sun Microsystems.
Spring Integration is a lightweight integration framework from the makers of Spring. Integration of data and services between applications is not easy – and often requires adaptation from one system to another. Spring Integration also promotes loosely coupled, event-driven applications. Spring Batch is a batch processing framework – providing a simple, idiomatic way to crunch large amounts of data across in a sustainable way. Spring Batch even allows you to distribute processing across multiple machines in a cluster. Naturally, both of these frameworks play very nicely on top of Cloud Foundry, which lets you scale up and out as demand requires.
In this talk, Josh Long introduces how to use Spring Batch and Spring Integration on Cloud Foundry, the open source PaaS from VMware.
About the speaker
Josh Long is the Spring developer advocate. Josh is the lead author on Apress’ Spring Recipes, 2nd Edition, and a SpringSource committer and contributor. When he's not hacking on code, he can be found at the local Java User Group or at the local coffee shop. Josh likes solutions that push the boundaries of the technologies that enable them. His interests include scalability, BPM, grid processing, mobile computing and so-called "smart" systems. He blogs at blog.springsource.org or joshlong.com.
There was a great post on Reddit the other day that explains the difference between
REST and SOAP in terms of Martin Lawrence. This has nothing to do with Spring, but was droll enough that it's worth sharing.
Spring, of course, has an amazing REST stack and I highly encourage people to check out how to build consolidated, streamlined REST services with Spring! Moving on... :)
James Rossiter has a good post on how to use a Spring InitBinder to Resolve Type Mismatch and bind Exceptions in POST from Spring MVC to Controller Actions.
@olivergierke brings up a great point on Twitter: how much code does it take to add the JTA 1.2 JSR javax.transaction.Transactional annotation to Spring? Almost nothing! Most of the code here is just unit tests. Otherwise, this is just a dead simple mapping of the JTA annotation to Spring's already supported engine, which also currently supports the native Spring @Transactional and @javax.ejb.TransactionAttribute annotation.
Spring has long supported a utility class, called the org.springframework.util.StopWatch, which can be used to measure the execution of method invocations.
The Javarevisited blog has a
nice post on how to use the StopWatch class.
If you have deployed applications on Cloud Foundry, you know how easy it is to push an app, bind services to it, and scale it. There are more magical things behind the scenes. Did you know, for example, that cloudfoundry.com is updated approximately twice a week? Each update included small changes such as a bug fix or a new feature, but often large changes such as updating the underlying operating system. Yet, we can do all this without any downtime for user apps. Come to this talk to understand what makes this possible. Even if you aren't going to ever implement a PaaS on your own (and why should you? we already give you a good one!), the architectural ideas apply to your distributed apps quite well.
About the speaker
Ramnivas Laddad is a SpringSource Principal Enginner. He has over a decade of experience in applying his enterprise Java and aspect-oriented programming (AOP) expertise to middleware, design automation, networking, web application, user interface, and security projects.
Ramnivas Laddad is a well-known expert in enterprise Java, especially in the area of AOP and Spring. He is the author of AspectJ in Action, the best-selling book on AOP and AspectJ that has been lauded by industry experts for its presentation of practical and innovative AOP applications to solve real-world problems. Ramnivas, a Spring framework committer, is also an active presenter at leading industry events such as JavaOne, JavaPolis, No Fluff Just Stuff, SpringOne, Software Development, and has been an active member of both the AspectJ and Spring communities from their beginnings.
NewSQL is a term that describes the next generation of highly distributed, scalable, memory oriented SQL databases. In this session, we will explore some basic concepts in NewSQL (VMWare SQLFire), translate a traditional “Star” schema to a partitioned schema(scale out design), walk through various SQL usage patterns – simple queries, complex joins, aggregations, stored procedures and explain how they can be more effectively realized in SQLFire through replicated tables, partitioned tables, in-memory or disk resident tables, parallel procedure execution, distributed transactions, etc.
We will also compare and contrast various NewSQL features with traditional SQL.
About the speakers
As the Chief Architect for GemFire product line, Jags is responsible for the technology direction for its high performance distributed data Grid and virtualization platform. Jags has represented GemStone Systems in the EJB expert group and the J2EE platform specification. In the past, Jags represented BEA in the W3C SOAP protocol specification, JAXM and other standards. Jags has presented in several conferences in the past on Data management, clustering and grid computing(Javaone, W3C workshop, Java user groups, Open Grid Forum, Platform Grid conference etc) . He has over 20 years of experience, a bachelors degree in computer science and a masters degree in management of science and technology.
Guillermo is an award-winning Enterprise Architecture practitioner with 17+ years of progressive experience in different industries. As a Regional Senior Systems Engineer for VMware's Cloud Application Platform division, Guillermo works with customers to understand their business needs and challenges and helps them seize new opportunities by leveraging vFabric to modernize their IT architecture. Guillermo is passionate about his family, business, technology and soccer.
Welcome to another installment of This Week in Spring! As usual, we've got a lot to cover, so let's get to it!
SpringSource CTO Adrian Colyer outlines the direction and momentum of SpringSource and the Spring projects under the
Pivotal Initiative, a new company spun out of EMC comprised of - among other things - SpringSource, Cloud Foundry, and GreenPlum.
This is definitely worth a read if you want to understand Spring's - ahem - Pivotal role in this new initiative!
Spring Batch lead Michael Minella has announced that Spring Batch 2.2.0.RC1 is now available.
The new release includes preliminary support for Spring Data, Java configuration support, non-identifying job parameters
and numerous fixes and polishes. This release is amazing, and definitely worth a look. I, personally, love the Java configuration API that's
been surfaced. You don't need to write another Spring Batch XML file if you don't want to!
Spring Mobile lead Roy Clarkson has announced that
Spring Mobile 1.1.0.M3 has been released featuring
simpler configuration when using a custom domain strategy with SiteSwitcherHandlerInterceptor, support for Kindle Fire device detection (as tablet or mobile depending on which mode they are in), several resolved issues and compatibility with Spring Framework 3.2.2.
The Spring Java Tutorial bloghas a nice post on using
stored procedures with Spring, and it also uses the same domain example - an EmployeeDAO.
They aren't exacty the same - far from it - but it does seem like one heckuva coincadence! At any rate, more information's always good.
KH Yiu has put together a cool post introducing the concept of a factory pattern (which you're no doubt already familiar with!)
in application code, built with Spring. This is not about how Spring uses the factory pattern, and was kind of an interesting approach.
Virtualizing and Tuning Large Scale Java Applications
This session shares many of the production proven methods of running Java on vSphere. Covering how to size JVMs, and VMs for large scale deployments. The session will have a special section on GC tuning and show how a wide range of JVMs can be tuned using a GC recipe developed over the past 15 years of actual field experience in tuning JVMs.
Three key trends and associated tuning techniques are discussed in this session. The key trends are: Consolidation, Elasticity and Flexibility, and Performance
Consolidation Many of our customers find that their middleware deployments have proliferated and are becoming an administrative challenge associated with higher costs. We see a trend across customers who look to virtualization as a way of reducing the number of server instances. At the same time, customers are taking the consolidation opportunity to rationalize the number of middleware components needed to service a particular load. Middleware components most commonly run within a Java Virtual Machine (JVM) with an observed scale of 100 to 1000s of JVM instances and provide many opportunities for JVM instance consolidation. Hence, middleware virtualization provides an opportunity to consolidate twice – once to consolidate server instances, and, secondly, to consolidate JVM instances. This trend is far-reaching, because every IT shop on the planet is considering the cost savings of consolidation. One customer in the hospitality sector went through the process of consolidating their server footprint and at the same time consolidated many smaller JVMs that were less than 1GB heap. They consolidated many of these smaller 1GB JVMs into 2 categories, those that were 4GB, and others that were 6GB. They performed the consolidation in such manner that the net total amount of RAM available to the application was equal to the original amount of RAM, but with fewer JVM instances. They did all of this while improving performance and maintaining good SLAs. They also reduced the cost of administration considerably due to the reduced number of JVM instances they had to manage, and refined environment that helped easily achieve SLA.
Another customer, in the insurance industry, was able to achieve the same as the above customer, but additionally was able to over-commit CPU in development and QA environments in order to save on third party software license costs. On the other hand, sometimes we come across customers that have a legitimate business requirement to maintain one JVM for an application, and/or one JVM per a line of business. In these cases, you cannot really consolidate the JVM instances, as that would cause intermixing of the lifecycle of one application from one line of business with another. However, while such customers don’t benefit from eliminating additional JVM instances through JVM consolidation, they do benefit from more fully utilizing the available compute resource on the server hardware, that otherwise would have been underutilized in a non virtualized environment
Elasticity and Flexibility It is increasingly common to find applications with seasonal demands. For example, many of our customers run various marketing campaigns that drive seasonal traffic towards their application. With VMware, you can handle this kind of traffic burst, by automatically provisioning new virtual machines and middleware components when needed, and then automatically tear down these VMs when the load subsides. In addition, the ability to change updating/patching hardware without causing outage is paramount for middleware that supports the cloud era scale and uptime. VMware VMotion gives you the ability to move VMs around without needing to stop applicators and or the VM. This flexibility alone makes virtualization of middleware worthwhile when managing large-scale middleware deployments. One customer in the financial space, handling millions of transactions per day, used VMotion quite often to schedule their hardware upgrades without any time downtime. What otherwise would be a costly scheduled downtime to their business.
Performance Customers often report improved middleware platform performance when virtualizing. Performance improvements are partly due to the updated hardware that customers will typically refresh during a virtualization project. There is also some performance improvement due to the robust VMware hypervisor. A recent customer that reported a great level of performance provided the following testimony
“With our OrderExpress project we upgraded our Middleware Services, Commerce, Portal, WCM, Service Layer, DB2 Database; migrated from AIX to Linux; virtualized on VMware; moved the application into a three-tier DMZ; increased our transactions by over 150 percent; and added significant new capabilities that greatly improved the customer experience. Changing such a wide range of technology components at once was a huge challenge. However using VMware vSphere and additional architectural changes we were successful in improving performance by over 300 percent; lowered costs in the millions; improved security, availability, and scalability; and how we plan to continue evolving this application to maintain greater than 30 percent yearly growth.”
– Jeff Battisti, Senior Enterprise Architect at Cardinal Health
In this session, I will show some actual JVM and VM sizes for middleware components both small and large JVMs. Will also detail out GC tuning recipe that I have developed over the years,that has been shown to handle JVM heap sizes form 4GB to 88GB+, and higher. Of course the introduction of in-memory databases has driven the trend to have these larger JVMs and hence why we will discuss what is the best way to tune the JVM, VM, and the hardware platform they are deployed on.
I see the sizing question as the most commonly asked question with our customer base,and as a result I plan to focus on it during the session.
About the speaker
Emad Benjamin has been in the IT industry for the past twenty years. He graduated with a Bachelor of Electrical Engineering from the University of Wollongong. Earlier in his career, he was a C++ software engineer, then in 1997, he switched to programming with Java, and has been focusing on Java ever since. For the past seven years, his focus has been Java on VMware vSphere, vFabric GemFire and SQLFire. Emad has been at VMware since 2005, and is the author of the Enterprise Java Applications Architecture on VMware book. Emad has previously presented at VMworld, SpringOne, and Open World on the subject of Java virtualization.
From Spring + Java to Spring + Akka - A Journey of Discovery
Actor based concurrency model is a paradigm shift. What is paradigm shift?
A change in the basic assumptions, or paradigms, within the ruling theory of science. A paradigm shift makes simple ideas hard to grok. Even though Actor model is a simple and revolutionary idea it becomes hard for programmers to see practical benefits and usage. Similarly, the Scala programming language brings a lot to the table in simplifying actor-based design, but comes with a new style of coding. One possible solution to this problem is to evaluate the new paradigm in terms of old paradigm. In this presentation we will take a working Spring based web application and gradually implement it using actors and Scala. We will be skeptical and suspicious of new ideas but at the same time we will be open minded. We will learn about actor based concurrency model using the knowledge of spring. At the same time, we'll learn best practices behind Actors, Scala and combining these with the Spring Framework.
About the speakers
Nilanjan is a consultant and trainer for Typesafe. He started his professional career as a software developer in 2000 using object oriented programming languages. Nilanjan has previously worked with IBM, ThoughtWorks and LivingSocial where he gained a lot of experience in managing and developing software solutions in Java/JEE, Ruby, Groovy and also in Scala. He is zealous about programming in Scala ever since he got introduced to this beautiful language. Currently he spends his spare time working on the scala-webmachine open source project (restful resource framework). In the past Nilanjan worked on other open source projects and libraries. At Typesafe he is mainly teaching and designing Scala and Play courses and helping customers to adopt these technologies. Nilanjan enjoys sharing his experience via talks at various conferences. He is also the author of the "Scala in Action" book.
Josh Suereth is a Senior Software Engineer at Typesafe and the author of "Scala In Depth.” He has been a Scala enthusiast ever since he came to know this beautiful language in 2007. He started his professional career as a software developer in 2004, cutting his teeth with C++, STL, and Boost. Around the same time, Java fever was spreading and his interest was migrating to web-hosted distributed Java-delivered solutions to aide health departments discover the outbreaks of disease - everything from EJB to Hibernate/Spring and even some Applets. He introduced Scala into his company code base first in 2007, and soon after he was infected by Scala fever, contributing to the Scala IDE, maven-Scala-plugin, and Scala itself. In 2009, he began writing the book "Scala In Depth" which provides practical support for using Scala in everyday applications. Today, Josh is the author of several open source Scala projects, including the Scala automated resource management library, the PGP sbt plugin, as well as contributing to key components in the Scala ecosystem, like the maven-Scala-plugin. His current work at Typesafe Inc. has him doing anything from building MSIs to profiling performance issues. Josh regularly shares his expertise in articles and talks.
Spring Data is a collection of projects intended to make it easier to develop Spring-powered applications that use new data access technologies such as non-relational databases. Based on a model of exposing Repository objects, Spring Data allows applications to access data in a simple and consistent way across many new platforms. Spring Batch 2.2.0.RC1 now provides ItemReader and ItemWriter implementations for a number of the data stores supported by Spring Data including MongoDB, Neo4j, and Gemfire (write only). In addition, Spring Batch 2.2.0.RC1 now has a RepositoryItemReader and RepositoryItemWriter that will read and write items from custom Spring Data Repository implementations.
With this release, Spring Batch 2.2.0.RC1 now supports Java based job definitions. Building a job definition with java configuration is now available via the new @EnableBatchProcessing annotation and a collection of builders that allow you to construct jobs, steps, flows, splits, etc. By using the @EnableBatchProcessing annotation the following features are enabled:
Creation of StepScope - Allowing the configuration of beans via @Scope("step")
@Autowired - A JobRepository, JobLauncher, JobRegistry, PlatformTransactionManager, JobBuilderFactory and StepBuilderFactory are all available to be autowired into your context.
Non-identifying Job Parameters
Spring Batch 2.2.0.RC1 now supports the use of job parameters that do not contribute to the generation of a JobInstance's identity. As part of this update, the JobParameters is no longer associated with a JobInstance and is now associated with a JobExecution. To support this change, the job repository schema has updated and a migration script has been provided. You can read the details about the migration script in the Getting Started Guide.
Other Improvements and Bug Fixes
With the release of Spring Batch 2.2.0.RC1, a host of other improvements and bug fixes have been added. The complete list of updates for this release can be found in the changelog for this revision.
Spring Mobile provides extensions to Spring MVC that aid in the development of cross-platform mobile web applications.
This release adds simpler configuration when using a custom domain strategy with SiteSwitcherHandlerInterceptor. Kindle Fire devices are now detected as tablet or mobile depending on which mode they are in. Additionally, several issues have been resolved in this release. This release is built and tested against Spring Framework 3.2.2. See the changelog and reference manual for more information. Many thanks to the community for their continued feedback and support in improving Spring Mobile.