Coherence Spring 3.0.0 M2 Released
The Oracle Coherence team is thrilled to announce the release of Coherence Spring 3.0.0 M2. This second milestone release of Coherence Spring is again packed with many new features and improvements, helping you to simplify the integration of Coherence into your Spring-based projects.
Spring Session
We have added the highly anticipated support for Spring Session, allowing you to use Coherence as a session repository. This enables clustered sessions without being tied to any application container specific solution.
In order to add Spring Session support to your Spring Boot application, simply add the coherence-spring-session
dependency to your project in addition to the Coherence Spring Boot Starter and Coherence dependency. You can also grab a starter project via start.spring.io.
Then in your Spring Boot application.yaml
file, configure the Coherence session support, e.g.:
application.yaml
As part of the Coherence Spring source code repository, we also provide a dedicated sample application for the Spring session support.
Coherence messaging and topics support
We have added Coherence messaging and topics support allowing you to develop message-driven applications backed by Coherence. In order to send messages, create a message publisher using the CoherencePublisher
annotation:
The resulting ProductClient
bean can be injected as a normal Spring bean dependency wherever it is needed. Reactive and non-blocking method definitions using Future
, Mono
, and Flux
are supported as well. To consume messages, use the @CoherenceTopicListener
annotation:
For further details and features, including how to define the commit behavior and how to forward messages with the @SendTo
annotation, check out the Messaging with Coherence Topics chapter of the reference documentation.
Spring Data improvements
Many improvements were added to the Spring Data support as well. A major addition is the new Projection support, to retrieve partial views of your entities. We have added support for:
- Interface-based Projections (Open and closed projections)
- Class-based Projections (DTO)
- Dynamic Projections
- Nullable Wrappers
But this not all, the latest Milestone release includes pagination support and we eliminated the requirement on the Java Persistence API. Thus, entities don’t have to be annotated with @Entity
any longer. Furthermore, Coherence Spring now supports the org.springframework.data.annotation.Id
annotation in addition to javax.persistence.Id
.
The Coherence Spring Data repository also saw several improvements: we now expose getMap()
on repository interfaces to allow access to the underlying Coherence NamedMap
and lastly, we added async repository support.
Coherence Metrics
We now provide Spring Boot auto-configuration support for Coherence Metrics. Simply add the coherence-micrometer
Maven dependency and Coherence metrics will be automatically exposed via Micrometer.
Other refinements
As part of this release we have updated the Coherence dependency to version 21.06
and the Spring Boot dependencies to 2.5.2.
Beside the aforementioned Spring Session sample, we have also added a sample and documentation for using Hibernate’s Second Level Cache (2LC) with Spring Boot and Coherence.
On the build side, we replaced the GitHub Site Maven Plugin with the Apache Maven SCM Publish Plugin to substantially reduce build times when deploying the project website.
Along with adding the various enhancements, the reference documentation is now 90 pages strong and will be further improved, polished and expanded as we get closer to the final release.
What’s Next?
As of right now we plan on publishing a release candidate within the next couple of weeks (RC1). A few improvements are still planned for the next release. For the Spring Cache abstraction support, add the Ability to set the TTL of cache entries as well as add ability to set a common cache prefix. Furthermore, the auto-configuration support needs to be polished in a few areas. Originally planned to be done in time for the M2 release, we are still working on the port of the Sock Shop micro-services demo to Spring.
We love your feedback!
As always, 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!