Jon Brisbin

Jon Brisbin

Alumni
Blog posts by Jon Brisbin

Reactor 2.0.0.RC1 with native Reactive Streams support now available!

Releases | February 18, 2015 | ...

The Reactor team is happy to announce the release of 2.0.0.RC1, which is now available in the spring.io Maven repository as well as Maven central. Version 2.0 is an #uberupdate from Reactor version 1.1 and contains several new components as well as complete rewrites of important classes like Stream, which now implements the Reactive Streams standard.

Please note that the Maven coordinates for Reactor 2.0 have changed from those for Reactor 1.x. The new coordinates all fall under the group ID io.projectreactor rather than the previous org.projectreactor. A sample dependencies block for a Gradle…

Reactor 2.0.0.M1 released with Reactive Streams integration!

Engineering | October 21, 2014 | ...

The Reactor team is frankly a little giddy at finally being able to announce an initial milestone release of Reactor 2.0! This update includes a fully-compliant Reactive Streams implementation in the completely re-written Stream and Promise APIs! This is a huge step for Reactor users. It opens up integration with other Reactive Streams implementations like Akka Streams, Ratpack, RxJava and others. Reactor provides a solid foundation upon which to build modern #uberfastdata applications with demanding high-throughput and low-latency requirements.

Stream and Promise

The headline change in Reactor 2.0 is the Stream API. In fact, most other parts of the codebase were either just lightly refined or remain untouched between 1.1 and 2.0. Not so with Stream and Promise. These components have been completely…

Reactor 1.1.0.RELEASE now available

Releases | May 06, 2014 | ...

The Reactor team is pleased to announce that some significant updates to the Reactor framework are now available in the 1.1.0.RELEASE version of Reactor's flexible, asynchronous, fast data framework. This version includes numerous bug fixes and rewrites of key components to make them faster and, maybe more importantly, more efficient in terms of memory usage. Reactor 1.1 now includes the fantastic gs-collections library from Goldman Sachs [1] which provides a very fluent API for dealing with maps and collections of all kinds.

Here is a non-exhaustive list of changes between Reactor 1.0 and 1.…

It can't just be Big Data, it has to be Fast Data: Reactor 1.0 goes GA

Releases | November 12, 2013 | ...

I'm happy to announce that Reactor, a powerful foundational library for building reactive, fast data applications on the JVM has reached GA!

What is Reactor and why should I care?

Reactor provides the necessary abstractions to build high-throughput, low-latency--what we now call "fast data"--applications that absolutely must work with thousands, tens of thousands, or even millions of concurrent requests per second.

You should care about Reactor because modern applications with non-human consumers--like mobile phones and the apps that run on them--generate more data than traditional thread-per…

Reactor 1.0.0.M2 – a foundation for reactive fast-data applications on the JVM

Engineering | August 27, 2013 | ...

I'm excited to announce the 2nd milestone release of Reactor on our way toward 1.0! Maven artifacts for Reactor 1.0.0.M2 are available in the usual milestone repository.

What is Reactor?

Reactor is a foundational framework for building high-throughput, asynchronous, reactive applications on the JVM. It provides Selector-style topic matching for event routing, dynamic Consumer assignment, an uber-fast task processor, and reactive Stream and Promise APIs for working with data asynchronously and coordinating asynchronous tasks. It comes with comprehensive Groovy language support by providing langauge extensions to make writing Reactor applications in Groovy pretty darned Groovy! It also has easy-to-use Spring support that automagically wires annotated POJOs to Reactors.

What's in this Release?

This 2nd milestone includes a number of bugfixes and some really exciting new features. Reactor now includes a Processor abstraction, which is a highly-optimized task processor based on the LMAX Disruptor RingBuffer. It uses the common abstractions from Reactor to configure a RingBuffer and allows you to use Reactor's common API instead of the Disruptor-specific API. It also by design skips the Selector matching and dynamic Consumer assignment provided by a Reactor in order to wring every last drop of throughput it can. Anecdotal benchmarks on a MacBook Pro show the Processor can pump around 100,000,000 events per second through the pipeline. Yes, you read that right: 100 million per second!

1.0.0.M2 also includes a small, but significant new feature in the Reactor API which optimizes event publishing in a Reactor to get about 30-50% higher throughput. It won't suit every situation since it prepares an optimized list of Consumers from the Reactor, but for an extra 10 million events per second in throughput, it's a great new feature.

Optimized Publish

One of the powerful aspects of Reactor is the Selector matching topic(ish) pub/sub. It allows you to easily assign handlers to events using topics, anonymous objects, assignable type hierarchies, URI path matching, or regular expressions (or any other type of Selector matching if you implement your own, domain-specific Selectors). But many applications can assign their handlers at startup, which means the path to those Consumers can be optimized for efficient event publication. The new Reactor method prepare(Object) allows you to pre-select the Consumers for a key. It returns a Consumer itself that event publishers can use to efficiently notify about new events.

// Create Environment in which Reactors operate
Environment env = new Environment();
Reactor reactor = Reactors.reactor().env(env).get();

reactor.on($("say.hello"), new Consumer<Event<String>>() {
	public void accept(Event<String> ev) {
		System.out.println("Hello " + ev.getData() + "!");
	}
});

Consumer<Event<String>> sayHello = reactor.prepare("say.hello");
for(String name : listOfNames) {
	sayHello.accept(name);
}

RingBuffer Task Processor

Reactor 1.0.0.M2 includes the Processor abstraction. It is a simple task processor backed by the LMAX Disruptor RingBuffer and is designed to integrate it seamlessly into the reactive APIs used in Reactor, so it uses common abstractions like Supplier and Consumer. A fully-configured Processor can be created in a single expression and using Java 8 lambdas is more succinct yet:

Processor<Message> proc = new ProcessorSpec<Message>()
	.dataSupplier({ return new Message(); })
	.consume({ msg -> // handle the updated Message object…

Reactor 1.0.0.M1 - a foundation for asynchronous fast-data applications on the JVM

Engineering | July 18, 2013 | ...

I'm super excited to announce the first milestone release of Project Reactor! Project Reactor is a foundational framework for building asynchronous, FastData applications on the JVM. Some of the goodness in Reactor 1.0.0.M1 includes: reactive composition helpers Stream and Promise, a TcpServer and TcpClient, and Groovy and Spring support. Inspired by Reactive Extenstions, RxJava, the new JDK 8 Stream API (and Scala, and others...), these Composables make coordinating asynchronous tasks dead simple. They support traditional callback-style programming using Consumers, but they also offer a…

Reactor - a foundation for asynchronous applications on the JVM

Engineering | May 13, 2013 | ...

We’re pleased to announce that, after a long period of internal incubation, we’re releasing a foundational framework for asynchronous applications on the JVM which we’re calling Reactor. It provides abstractions for Java, Groovy and other JVM languages to make building event and data-driven applications easier. It’s also really fast. On modest hardware, it's possible to process over 15,000,000 events per second with the fastest non-blocking Dispatcher. Other dispatchers are available to provide the developer with a range of choices from thread-pool style, long-running task execution to non…

Spring Data REST 1.1.0.M1 Released

Releases | March 11, 2013 | ...

The Spring Data team is happy to announce the next major step in the evolution of exporting domain objects to the web using RESTful semantics: Spring Data REST 1.1.0.M1 is now available in the SpringSource milestone repository.

Spring Data REST Home | Source on GitHub | Reference Documentation

Export domain objects to the web

Spring Data REST is a set of Spring MVC components that you can add to your own Spring MVC applications that export your Spring Data Repositories to the web using RESTful, HATEOAS semantics. It provides a consistent interaction API by exporting repositories to RESTful URLs that are configurable in a couple different ways.

Spring Data REST supports CRUD for top-level entities (those domain objects directly managed by a Spring Data Repository) by literally writing a single line of code that defines an interface that extends Spring Data's CrudRepository interface. That done, your entities then have full RESTful semantics. You can create new ones, update existing ones, and delete them using standard URLs that are, following the principles of HATEOAS, discoverable. That means the user agent accessing your Spring Data REST application doesn't need to have advance knowledge of what resources you are exporting. It can discover what entites exist and what relationships exist on those entities by successive calls to URLs provided in the JSON. These "links" are the real foundation and power of a HATEOAS REST application.

Changes from the ground up

Version 1.1 is virtually a re-write from the ground up. Not only is it easier to configure than 1.0 and better conforms to Spring MVC expections for the transition to Spring 3.2, but the biggest change in the internals of Spring Data REST is that it now supports other types of Spring Data repository implementations beyond just JPA. The HTTP semantics for CRUD and manging relationships (if the datastore supports it) remain the same no matter what backing datastore is used.

That means it's now possible to export JPA entities and MongoDB entities within the same Spring Data REST application and access those entities using a common URL structure and using the standard Spring HATEOAS Resource representation for all entities and collections. The user agent accessing those RESTful URLs does not need any special knowledge on which datastore the backing entities are managed by and, most importantly, you don't have to write any code to get that functionality!

MongoDB support

Spring Data REST 1.1 now supports exporting MongoDB CrudRepository implementations. The same HTTP semantics apply to MongoDB @Document entities as apply to JPA entities. GET, POST, PUT, DELETE are of course supported, but so is @DBRef. You can view and manage the relationship between two documents using GET, POST, PUT, and DELETE and you can export finder methods based on your @Query definitions. Please reference the spring-data-mongodb reference documentation for the full details of how the object mapping differs from JPA style mapping and how query definitions work.

Gemfire support

Spring Data REST 1.1 now supports exporting entities that use the high-performance Gemfire database to different Regions. Read the Spring Data Gemfire documentation for the full explanation of the vast configuration options and how POJO mapping in Gemfire differs from other mapping technologies.

Neo4J support is next

Spring Data REST 1.1 is now set to support Neo4J GraphRepositorys with the next version of spring-data-neo4j, version 2.3. When that's generally available (which should be around or before the general availablity of Spring Data REST 1.1 RELEASE), you will be able to access @NodeEntitys and their relationships using standard HATEOAS semantics, just like you do with the other datastores.

Add it to your existing apps

Spring Data REST is designed in such a way that you can, if you wish, create an entire application for the Spring Data REST application. It's just a standard Spring MVC webapp after all. But things get really interesting when you add Spring Data REST to your own services.

Spring HATEOAS author Oliver Gierke has created an example application that demonstrates the use of HATEOAS principles in a modern web application. It's called spring-restbucks and is an implementation of the Restbucks application described in the Systematic Theology of REST services: REST in Practice by Jim Webber, Savas Parastatidis and Ian Robinson.

Mixin REST services

By mixing Spring Data REST with your other RESTful services, you can get a seamless integration between those domain objects exported by Spring Data REST--objects for which you didn't have to write any code to have them exposed--and those services that don't represent an actual entity but a process. You can see an example of how a payment service might interact with domain object CRUD in the spring-restbucks application, where credit card payment processing is handled by a custom controller, while object CRUD is handled by Spring Data REST. Your custom controllers can actually piggyback onto the Spring Data REST URLs so that a consistent and simple URL structure can be maintained throughout the appliation, no matter whether the URL refers to your custom controller, a Spring Data REST JPA Repository, or any of the other supported Repository styles.

It's not exclusive

It's not an either-or with Spring Data REST. If you don't want all of your Repositories exposed to a web client, no problem! There a several different ways you can turn off functionality for Repositories. You can embed annotations into your source code or, if you don't have access or simply can't add the Spring Data REST annotations, you can use a fluent, DSL-style configuration to tell Spring Data REST how your resources should be exposed. Using Spring Data REST in your application isn't an exclusive committment to only one way of doing things. Spring Data REST is structured in a what that it will play nicely with your existing application so you can incorporate those bits of functionality from Spring Data REST you want, while still maintaining all the custom-coded services you're used to creating in Spring MVC controllers.

JSONP support moving to a filter

The JSONP support that was built into Spring Data REST 1.0 has been removed from the core framework in preference to a forthcoming general-purpose JSONP Serlvet Filter that will work much better than the way JSONP was implemented in version 1.0. When that filter is generally available, then JSONP support can be added not just to Spring Data REST, but virtually any Servlet-based REST resource.

Installation and Documentation

To get started playing with Spring Data REST, have a look at the reference documentation to get the lay of the land, so to speak, and get started playing with it in your own application by simply adding a dependency to the spring-data-rest-webmvc artifact (currently at 1.1.0.M1 in the SpringSource milestone repository) then import the Spring Data REST configuration like you see being done in the spring-restbucks application.

Learn more at CONFESS_2013

If you're planning on attending CONFESS_2013 in Vienna the first week of April, then you can hear all about Spring Data REST at my talk on exporting entities to the web.

Links

Spring Data REST Home | Source on GitHub | Reference Documentation

Spring Data REST 1.0.0.RC3 Released

Releases | September 14, 2012 | ...

I'm pleased to announce the release of Spring Data REST 1.0.0.RC3! This release includes a significant number of bug fixes, changes to the structure of the JSON representation, better integration of user-defined Jackson Modules that are bootstrapped into the internal ObjectMapper, as well integration with Spring HATEOAS. Also included in this release is support for extending the resource representation (e.g. to add links to other, related resources) using the Spring HATEOAS ResourceProcessor abstraction.

New functionality includes:

  • JSON output looks different in an effort to make property names consistent and structure clearer.
  • Pulls in any Jackson Module beans discovered and integrates user configuration with internal ObjectMapper.
  • Integration with Spring HATEOAS - Customize the outgoing JSON by adding or removing links or otherwise altering the resource.

Starter Web Application | Wiki | Release Notes

To learn more about the project, visit the Spring Data REST homepage, or visit the Github repository

Spring Data REST 1.0.0.RC2 Released

Releases | July 31, 2012 | ...

I'm pleased to announce the release of Spring Data REST 1.0.0.RC2! Beyond a number of bug fixes, this release adds support for JSONPE (JSONP with error handling), the ability to turn off CRUD methods with the @RestResource annotation, and is now built and tested against the Servlet 3.0 API (though it is not yet 3.0 specific, so will still work fine in Servlet 2.5 containers).

New functionality includes:

  • JSONPE - Simply add a URL parameter to have the results wrapped in a call to the Javascript function you specify. Also handles server errors by translating an error to HTTP 200 and passing the original status code as the first parameter of your error handler.
  • Turn off CRUD methods - The exporter now respects @RestResource annotations on CRUD methods. Just override the method from CrudRepository you want to turn off and annotate it with @RestResource(exported = false).
  • Better integration with existing Spring MVC applications - Simplified the internal Spring MVC configuration to make it even easier to integrate with your existing Spring MVC application. Simply including the RepositoryRestMvcConfiguration bean into your own configuration should Just Work.

New or updated documentation includes:

Starter Web Application | Wiki | Release Notes

To learn more about the project, visit the Spring Data REST homepage, or visit the Github repository to…

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