Monday, 10 February 2020

Infinispan Spring Boot Starter released with Spring Boot 2.2.4.RELEASE

Dear Infinispan and Spring Boot users,

We are pleased to announce the release of Infinispan Spring Boot  2.1.8.Final and 2.2.0.Final.

2.1.8.Final uses Infinispan 9.4.17.Final and Spring Boot 2.2.2.RELEASE

2.2.0.Final uses Infinispan 10.1.1.Final and Spring Boot 2.2.2.RELEASE 

Configuring Marshalling with Infinispan 10.x

Infinispan 10.x servers have some significant changes to marshalling that impact Spring Boot users.

The default Marshaller for Infinispan 10.x is ProtoStream, which uses Protocol Buffers to provide extensible, language and platform neutral serialization.

Unfortunately ProtoStream does not currently work with Infinispan Spring Cache and Session support. As a result, Spring users in Remote Client/Server Mode must use the Java Serialization Marshaller and add classes to a Java serialization whitelist.

Add the following configuration properties:

infinispan.remote.marshaller=org.infinispan.commons.marshall.JavaSerializationMarshaller infinispan.remote.java-serial-whitelist=org.infinispan.tutorial.simple.spring.remote.*

The infinispan.remote.java-serial-whitelist property specifies the classes, or packages, that Java serialization can marshall. Separate multiple class names with a comma (,).

Note that, in previous versions, JBoss Marshaller was the default for Infinispan. Spring users can also use JBoss Marshalling, but it is deprecated as of Infinispan 10.x.

Get it, Use it, Ask us!

You can find these releases in the maven central repository.

Please report any issues in our issue tracker and join the conversation in our Zulip Chat to shape up our next release.

Enjoy,

The Infinispan Team

Posted by Katia Aresti on 2020-02-10
Tags: release spring boot spring

Tuesday, 15 January 2019

Infinispan Spring Boot Starter 2.1.2.Final is out!

Dear Infinispan and Spring Boot users,

We have just released Infinispan Spring Boot 2.1.2.Final.

2.1.2.Final is using Spring Boot 2.1.2.RELEASE and contains some bug fixes related to JCache and Actuator integration.

The starter is now using Infinispan’s last stable release: 9.4.5.Final.

You can find this release in the maven central repository.

Please report any issues in our issue tracker and join the conversation in our Zulip Chat to shape up our next release.

Enjoy,

The Infinispan Team

Posted by Katia Aresti on 2019-01-15
Tags: release spring spring boot

Tuesday, 11 December 2018

Infinispan Spring Boot Starter 2.1.1.Final and 1.0.4.Final are out!

Dear Infinispan and Spring Boot users,

We have just released Infinispan Spring Boot 2.1.1.Final and 1.0.4.Final.

1.0.4.Final is using Spring Boot 1.5.17.RELEASE

2.1.1.Final is using Spring Boot 2.1.1.RELEASE 

Both starters are now using Infinispan’s last stable release: 9.4.4.Final.

9.4.4.Final provides full support to JDK 11, Spring 4 and 5. Concerning Spring 5, it includes Spring Session 2.1.2.RELEASE support.

You can find these releases in the maven central repository.

Please report any issues in our issue tracker and join the conversation in our Zulip Chat to shape up our next release.

Enjoy,

The Infinispan Team

Posted by Katia Aresti on 2018-12-11
Tags: release spring-session spring spring boot

Friday, 02 November 2018

Near caching with Spring-Boot and Infinispan

We have recently released infinispan-spring-boot-starter 2.0.0.Final. This version supports Spring Boot 2.1 and Infinispan 9.4.0.Final.

Before this release, some important features - such as near caching - were only configurable by code. From now on, we can set all of the Hot Rod client configuration using the hotrod.properties file or the Spring application YAML. The latter is an important community requirement we had.

Let’s see how to speed up our applications performance with near caching!

==

==

Hot Rod

 

Just as a quick reminder, Infinispan can be used embedded in your application or in client/server mode. To connect you application to a server you can use an Infinispan Client and the Infinispan “Hot Rod Protocol”. Other protocols are available, such as REST, but Hot Rod is the most recommended way since it is the one that supports most of the Infinispan functionalities.

Near cache

From the Infinispan documentation: Hot Rod client can keep a local cache that stores recently used data. Enabling near caching can significantly improve the performance of read operations get and getVersioned since data can potentially be located locally within the Hot Rod client instead of having to go remote.

When should I use it? 

Near caching can improve the performance of an application when most of the accesses to a given cache are read-only and the accessed dataset is relatively small. When an application is doing lots of writes to a cache, invalidations, evictions and updates to the near cache need to happen. In this scenario we won’t probably get much benefit.

As I said in the introduction, the good news is that this feature can be activated just by configuration. Code doesn’t change, so we can measure the benefits, if such exist, in a very straightforward way.

Spring-Boot

I have created a very simple application, available here. Maven, Java 8 and an Infinispan server are required to run it. You can download the server or use docker.

Docker: docker run -it -p 11222:11222 jboss/infinispan-server:9.4.0.Final

Standalone: PATH/infinispan-server-9.4.0.Final/bin/standalone.sh

Once the server is up and running, build the application using maven 

>> infinispan-near-cache: mvn clean install

Writer 

This application loads the required data to a remote cache: a list of some of the Infinispan contributors over the last decade.

>> writer: mvn spring-boot:run

Reader 

The reader application does 10.000 accesses to the contributors cache. Using a random id, I call 10.000 times the get method. The job gets done in my laptop in ~4000 milliseconds.

>> reader-no-near-cache: mvn spring-boot:run

Activating the near cache

I need to configure two properties:

  • Near Cache Mode: DISABLED or INVALIDATED. Default value is DISABLED, so I turn it on with INVALIDATED.

  • Max Entries: Integer value that sets the max size of the near caches. There is no default value, so I set up one.

The hotrod client configuration is for each client, not for each cache (this might change in the future). With that in mind, note that configuring the previous properties will activate near caching for all the caches. If you need to activate it just for some of them, add the following property:

  • Cache Name Pattern:  String pattern. For example "i8n-.*" will activate the near caching for all the caches whose name starts by "i8n-".

Configuration can be placed in the hotrod-client.properties, Spring-boot configuration or code.

hotrod-client.properties

infinispan.client.hotrod.near_cache.mode=INVALIDATED

infinispan.client.hotrod.near_cache.max_entries=40

infinispan.client.hotrod.near_cache.cache_name_pattern=*i8n-.

application.yaml (or properties)

infinispan:    remote:      near-cache-mode: INVALIDATED      near-cache-max-entries: 10      near-cache-cache-name-pattern: i8n-.*

code 

With the Infinispan Spring-Boot Starter, I can add custom configuration using the InfinispanRemoteCacheCustomizer.

Results

My dataset contains 25 contributors. If I activate the near cache with max 12 entries and I run my reader again, I get the job done in ~1900 milliseconds, which is already an improvement. If I configure it to hold the complete dataset, I get it done in ~220 milliseconds, which is a big one!

Conclusions

Near caching can help us speed up our client applications if configured properly. We can test our tuning easily because we only need to add some configuration to the client. Finally, the Spring-Boot Infinispan Starter helps us build services with Spring-Boot and Infinispan. 

Further work will be done to help Spring-Boot users work with Infinispan, so stay tuned! Any feedback on the starter or any requirement from the community is more that welcome. Find us in Zulip Chat for direct contact or post your questions in StackOverflow!

Posted by Katia Aresti on 2018-11-02
Tags: hotrod near caching spring spring boot

Thursday, 11 October 2018

Infinispan Spring Boot 2.0.0.Final is out!

Dear Infinispan and Spring Boot users,

We have just released Infinispan Spring Boot 2.0.0.Final. If you are wondering why it is worth to use this starter, read Sebastian’s article here!

Highlights of this release include:

  • Uses the latest Infinispan 9.4.0.Final

  • Automatic translation of Hot Rod client properties into Spring YAML (ISPN-9437)

  • Bug fixes

You can find the release in the maven central repository.

Please report any issues in our issue tracker and join the conversation in our Zulip Chat to shape up our next release.

Enjoy,

The Infinispan Team

Posted by Katia Aresti on 2018-10-11
Tags: spring spring boot

Tuesday, 04 September 2018

Infinispan Spring Boot Beta2 is out!

Dear Infinispan and Spring Boot users,

We have just released Infinispan Spring Boot 2.0.0.Beta2.

Highlights of this release include:

  • Upgrade to Spring Boot 2.0.3.RELEASE

  • RemoteCache can be injected now. Example here 

You can find the release in the maven central repository.

Please report any issues in our issue tracker and join the conversation in our Zulip Chat to shape up our next release.

Enjoy,

The Infinispan Team

Posted by Katia Aresti on 2018-09-04
Tags: release spring boot spring beta

Monday, 22 May 2017

Infinispan Spring Boot Starters 1.0.0.Final released

We are happy to announce that Infinispan Spring Boot Starters 1.0.0.Final have been released.

Change-list:

You can grab the bits from JBoss Repository after the sync is complete. In the meantime, grab them from here.

Posted by Sebastian Łaskawiec on 2017-05-22
Tags: spring

Wednesday, 15 March 2017

Spring Boot Starter 1.0.0.CR1 released!

I’m happy to announce a new release (the first feature-complete!) of Infinispan Spring Boot Starters.

We finally added new properties for managing Hot Rod client mode in application.properties as well Spring Cache automatic support. Finally, we fixed a couple of smaller issues.

For complete changelog, please refer to the release page.

The artifacts should be available in Maven Central as soon as the sync completes. In the meantime grab them from JBoss Repository.

Posted by Sebastian Łaskawiec on 2017-03-15
Tags: spring

Tuesday, 20 December 2016

Spring Boot Starters

Ho, ho, hooo! It looks like all members of Infinispan Community have been nice and Santa brought you Spring Boot Starters!

image

This will make you even more productive and your code less verbose!

Why do I need starters?

Spring Boot Starters make the bootstrapping process much easier and faster. The starter brings you required Maven dependencies as well as some predefined configuration bits.

What do I need to get started?

The starter can operate in two modes: client/server (when you connect to a remote Infinispan Server cluster) and embedded (packaged along with your app). The former is the default. It’s also possible to use both those modes at the same time (store some data along with your app and connect to a remote Infinispan Server cluster to perform some other type of operations).

Assuming you have an Infinispan Server running on IP address 192.168.0.17, all you need to do is to use the following dependencies:

By default, the starter will try to locate hotrod-client.properties file. The file should contain at least the server list:

It is also possible to create RemoteCacheManager's configuration manually:

That’s it! Your app should successfully connect to a remote cluster and you should be able to inject RemoteCacheManager.

Using Infinispan embedded is even simpler than that. All you need to do is to add additional dependency to the classpath:

The starter will provide you a preconfigured EmbeddedCacheManager. In order to customize the configuration, use the following code snippet:

Further reading

There are two link I highly recommend you to read. The first is the Spring Boot tutorial and the second is the Github page of the Starters project

Kudos

Special thanks go to Marco Yuen, who donated us with Spring Boot Starters code and Tomasz Zabłocki, who updated them to current version and Stéphane Nicoll who spent tremendous amount of time reviewing the Starters.

Posted by Sebastian Łaskawiec on 2016-12-20
Tags: spring

Monday, 28 November 2016

Spring as a Spec?

We’ve been maintaining Spring integrations bits in Infinispan for quite a while. Our development version, Infinispan 9, contains a set of changes in those modules which deserve some explanation…​

Versions…​ versions everywhere…​

image

When you use Infinispan, you rely on some, very specific version. The same applies to Spring. Before Infinispan 9 our integration modules had a compile-time dependency to a very specific version of Spring. In practice, we imposed this specific version to each project which used our integration bits. The question is - what to do to use some other version of Spring or Spring Boot? Till Infinispan 9, the simplest solution was to exclude Spring from infinispan-spring4-embedded (or infinispan-spring4-remote) artifact using Maven exclusions. Not a very nice and intuitive solution was it?

How about treating Spring as a Spec or API

You probably noticed, when you use JPA you don’t care about underlying implementation. Is it Hibernate, OpenJPA…​ it doesn’t matter?

If you think carefully about Spring for a while, it’s a bit similar. All core classes might be delivered using standard dependency mechanism (adding spring-beans, spring-context manually), using Spring Boot (adding spring-boot-starter) or even using 3rd party integration tools like DropWizard. In case of a bigger project, a decision whether or not use any of those solutions needs to be taken long before Infinispan is chosen as a Distributed Store or Cache.

At this point, we can do a mental experiment - treat Spring classes as a Spec or API and those delivery mechanisms treat as implementations.

===

===

===

Scope? Provided, of course!

From Infinispan integration perspective we need the Spring API (the classes) and we don’t care about the implementation (delivery mechanism). Having this in mind we decided to change Spring’s scope in Infinispan modules to provided.

I use Infinispan and Spring, what shall I do?

Starting from Infinispan 9, you can stop using exclusions. You probably already use Spring and your favorite delivery mechanism (Spring Boot for example). Then add infinispan-spring4-embedded or infinispan-spring4-remote artifact. Finally, you need to decide how would you like to use Infinispan - via Uber Jars (infinispan-embedded and infinispan-remote) or using Small Jars (infinispan-core for example).

That’s it! Have fun!

Posted by Sebastian Łaskawiec on 2016-11-28
Tags: spring

News

Tags

JUGs alpha as7 asymmetric clusters asynchronous beta c++ cdi chat clustering community conference configuration console data grids data-as-a-service database devoxx distributed executors docker event functional grouping and aggregation hotrod infinispan java 8 jboss cache jcache jclouds jcp jdg jpa judcon kubernetes listeners meetup minor release off-heap openshift performance presentations product protostream radargun radegast recruit release release 8.2 9.0 final release candidate remote query replication queue rest query security spring streams transactions vert.x workshop 8.1.0 API DSL Hibernate-Search Ickle Infinispan Query JP-QL JSON JUGs JavaOne LGPL License NoSQL Open Source Protobuf SCM administration affinity algorithms alpha amazon anchored keys annotations announcement archetype archetypes as5 as7 asl2 asynchronous atomic maps atomic objects availability aws beer benchmark benchmarks berkeleydb beta beta release blogger book breizh camp buddy replication bugfix c# c++ c3p0 cache benchmark framework cache store cache stores cachestore cassandra cdi cep certification cli cloud storage clustered cache configuration clustered counters clustered locks codemotion codename colocation command line interface community comparison compose concurrency conference conferences configuration console counter cpp-client cpu creative cross site replication csharp custom commands daas data container data entry data grids data structures data-as-a-service deadlock detection demo deployment dev-preview development devnation devoxx distributed executors distributed queries distribution docker documentation domain mode dotnet-client dzone refcard ec2 ehcache embedded embedded query equivalence event eviction example externalizers failover faq final fine grained flags flink full-text functional future garbage collection geecon getAll gigaspaces git github gke google graalvm greach conf gsoc hackergarten hadoop hbase health hibernate hibernate ogm hibernate search hot rod hotrod hql http/2 ide index indexing india infinispan infinispan 8 infoq internationalization interoperability interview introduction iteration javascript jboss as 5 jboss asylum jboss cache jbossworld jbug jcache jclouds jcp jdbc jdg jgroups jopr jpa js-client jsr 107 jsr 347 jta judcon kafka kubernetes lambda language learning leveldb license listeners loader local mode lock striping locking logging lucene mac management map reduce marshalling maven memcached memory migration minikube minishift minor release modules mongodb monitoring multi-tenancy nashorn native near caching netty node.js nodejs non-blocking nosqlunit off-heap openshift operator oracle osgi overhead paas paid support partition handling partitioning performance persistence podcast presentation presentations protostream public speaking push api putAll python quarkus query quick start radargun radegast react reactive red hat redis rehashing releaase release release candidate remote remote events remote query replication rest rest query roadmap rocksdb ruby s3 scattered cache scripting second level cache provider security segmented server shell site snowcamp spark split brain spring spring boot spring-session stable standards state transfer statistics storage store store by reference store by value streams substratevm synchronization syntax highlighting tdc testing tomcat transactions tutorial uneven load user groups user guide vagrant versioning vert.x video videos virtual nodes vote voxxed voxxed days milano wallpaper websocket websockets wildfly workshop xsd xsite yarn zulip

back to top