-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Update Infinispan dependencies to 9.0.1.Final #9417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@galderz Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please explain if the sample is broken with Infinispan 9? If so, a link that explains the change would be appreciated.
If the sample is broken now, I think we should fix it regardless of the update.
Are you aware that infinispan provides a starter of their own?
</dependency> | ||
<dependency> | ||
<groupId>org.infinispan</groupId> | ||
<artifactId>infinispan-core</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is that extra dependency necessary. Has something changed in 9.x that the core isn't provided with the embedded module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Starting with Infinispan 9 infinispan-jcache
module has infinispan-core
as provided
dependency. So if an end-user application depends on infinispan-jcache
, it must also depend on infinispan-core
. More info can be found here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry but that link doesn't give me any extra info. Can you please clarify? What justify the fact we need to add two dependencies now? Having a infinispan-jcache
module IMO should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'm trying to find out more on this.
`infinispan.xml` configuration instead. | ||
file so if you don't specify anything it will bootstrap on a hardcoded default. However, | ||
for the sample application to work, `spring.cache.infinispan.config` needs to be set to | ||
`infinispan.xml` so that necessary caches can be found. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And infinispan.xml
is no longer used as a default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
infinispan.xml
has never been a default for us. We've never had a default configuration file name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I get it now. That's because previously you'd have created a "default cache". Yeah I remember that now. Perhaps I should fix that part of the sample differently then. I'll give it some thoughts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to provide both core and the embedded
dependencies? I thought that was JCache only...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess by embedded
you mean infinispan-embedded
artifact id. If so, infinispan-embedded
should never be a dependency in a Maven project. embedded
is really an uber jar designed for those who still use Ant. Having it as a Maven dependency can cause troubles.
I'm not aware of any infinispan-embedded
dependencies inside spring-boot
repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean the dependency in the doc and the code, infinispan-spring4-embedded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, let me check that out...
Hi @snicoll
Yeah, before Infinispan 9, you could just retrieve non-default any cache even if no configuration file or no default cache configuration had been defined. However, starting with Infinispan 9 this is no longer possible. So, if you want to access cache So, the simplest fix is to simply define the The Infinispan 9 changes in this are are explained here.
The sample is only broken when using Infinispan 9+.
I do indeed, I'm a colleague of @slaskawi. We still want to make sure any Infinispan examples within Spring Boot repo are up to date. |
@galderz Thank you for signing the Contributor License Agreement! |
<infinispan xmlns="urn:infinispan:config:7.2"> | ||
|
||
<cache-container default-cache="default"> | ||
<cache-container default-cache="countries"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I don't understand. Isn't the local-cache
below creating a cache named countries
? countries
is just one cache used in the application, it's not the default cache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but you also need to provide a default cache definition. That file, as it was, would not work because there was no cache named default
in the file. There were two ways to solve it:
a. Add default
cache definition, e.g.
<local-cache name="default"/>
b. Set countries
as default cache.
I opted for b. since it was less config. It means countries
cache could be retrieved via getCache()
or getCache("countries")
call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think having countries
as the default cache is a good idea for the sample. None of the other samples do that. I've already polished that part in fc38c1b based on your feedback so we should be good already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok, thx for fixing that! That looks good. With my changes, I'd only need to update the schema version and that'd be fine.
Clarify the cache sample and in particular that Infinispan does not bootstrap with a default configuration file. Hence the custom `infinispan.xml` configuration is enabled by default if Infinispan is available on the classpath. See gh-9417
@galderz any news about that new required dependency? IMO that's pretty bad for users upgrading if that's mandatory all the sudden. |
Sorry for delay (travel). We're in the middle of a dev discussion that I need to catch up on. I'll update as soon as I have something. The current latest version would require the dependencies to be like this though. I'm trying to get that changed in the next point release. |
@galderz thanks. We'll wait for that then. |
@snicoll I'm trying to build master but does not seem to work? Trying to build with JDK 8
Ring a bell? |
No but I just found out that Spring Data changed some of their APIs and we're consuming their snapshot. @wilkinsona is looking into it right now. |
* infinispan-core dependency needed since this is now provided for infinispan-cache. * To access "countries" cache, it's necessary to define it in advance now, so a configuration file needs to be passed in. * Use "countries" as default cache that needs to be predefined.
Thanks @wilkinsona and @snicoll, master is indeed compiling now. @snicoll Let's close this PR. Infinispan 9.0.3.Final has been released which does not require the extra |
New PR is #9688 |
@galderz for the record there is no need to open a new PR. If you push force on the branch you used to create the PR it will be updated. |
I'm aware. I regularly do that, but in this case I wanted to keep around the other branch just in case, and the update was sufficiently different, and much more simplified, to deserve a separate PR :) |
Update Infinispan dependencies and fix sample cache example so that it works with Infinispan 9.