Coherence Spring 3.0.0 M1 Released
The Oracle Coherence team is stoked to announce the release of Coherence Spring 3.0.0 M1. This is the first milestone release and represents a complete reboot of the Coherence Spring project.
This release is loaded with new features, helping Spring developers to substantially simplify the integration of Spring-based applications with Oracle Coherence.
We have refactored the bootstrapping mechanism to use the new Coherence Bootstrap API, allowing for a much simpler user-experience. When using Spring Boot, starting Coherence cluster member within the same JVM has become as easy as adding the Coherence Spring Boot Starter dependency to your project:
CoherenceAutoConfiguration will kick in, bootstrap Coherence, and you can immediately start injecting Coherence dependencies into your Spring-managed classes using a rich set of available annotations including:
- Filter Binding Annotations
- Extractor Binding Annotations
- and many more
For instance, the following usage will inject a Coherence
You can also inject other Coherence-managed objects such as:
Fine-grained customization of the configuration is of course possible if needed. We also provide initial support for dedicated Spring Boot configuration properties to customize the integration of Coherence. Additionally, we have added preliminary support for Spring Boot’s Config API in order to allow you to import additional configuration data using Coherence as a store of such configuration data by using the Spring Boot property
spring.config.import with the value prefix
Coherence Event Listeners
The Coherence Spring team added support for Coherence server- and client-side events. As such, you can add Coherence event listeners with the
This example will listen to client-side
MapEvents for the map named
people. Using the optional
WhereFilter, the event listener will only be triggered for people older than 18 years of age using a CohQL expression.
Coherence Spring adds support for Spring Data repositories using the brand-new Coherence Repository API which has been introduced in
Coherence CE 21.06 M2. This allows you to use Spring Data with Coherence as a back end data store.
If you need to use Coherence for caching using Spring’s Cache abstraction, just add the
@EnableCaching annotation and
CoherenceAutoConfiguration will add a
CoherenceCacheManager to the Spring
Now you can take advantage of Spring’s Cache abstraction that is backed by Coherence and use the relevant Spring annotations such as
How to get started?
The project source repository includes several sample applications. We have also provided the Coherence To Do List Example Application in a separate repo, as a more complete example of the integration of Spring Boot and Coherence. On the front-end, it provides REST and GraphQL APIs using either a React-based front-end or a JavaFX client application. For the backend, a Spring Data-based Coherence repository is used.
For the next Milestone 2 release we plan on adding support for:
- Spring Session
- Expanded Spring Data support (async repositories, projection support, and pagination)
- Added support for messaging/topics
- Port the Sock Shop micro-services demo to Spring
The final 3.0.0 release is planned for later this summer. For a complete list of changes, please see the Release Notes.
We love your feedback!
Lastly, we would love to hear from you! Now is the time to evaluate Coherence Spring, provide feedback and help to incorporate any suggestions for improvement. The best way to follow progress is the Coherence Spring GitHub repository. If you have questions, please join our Slack channel or ask questions on Stack Overflow. Coherence Spring is an open source project, and contributions are always welcome!