Closed edeandrea closed 4 years ago
@edeandrea thanks for your contribution. In order to understand your PR clearly before merging, can you take a look at the following inquires?
1) You need to remove the space here: *Red Hat the embeddedCache 2) It was supposed not to use too much backtick so do you have a specific reason to replace bold or italic font with backsticks? 3) org.infinispan.configuration.cache.Configuration class is already imported in the EmbeddedCacheService class and do you have a specific reason why you replaced with final org.infinispan.configuration.cache.Configuration ispnConfig = new ConfigurationBuilder()? 4) Do you have a specific reason why you removed "TODO: Add SessionController class her" part?
Hi @danieloh30 see answers. Also note that this PR coincides with https://github.com/RedHat-Middleware-Workshops/dg8-workshop-labs/pull/1 so please take a look at that as well as it may help answer some of these questions.
@Configuration
class. Since the Configuration
import is now taken for the Spring @Configuration
annotation, I needed to be explicit for the org.infinispan.configuration.cache.Configuration
classSessionController
class I moved to a standalone class that is already there in the codebase vs having the user copy/paste it in. I just think that is cleaner.Wherever possible I replaced all class names with backtiks as I found some were bold, some were backtick'ed, some italicized, and some nothing. I tried best I could to be consistent. I've always found that backticks for anything code related (class names, method names, etc) are preferred. Even here on GitHub most people encapsulate code-related stuff in backtiks.
Yes there is a PR - see https://github.com/RedHat-Middleware-Workshops/dg8-workshop-labs/pull/1
Nope, I don't want to use too many backticks. Can you add guides to create SessionController.java and add codes and import org.infinispan.configuration.cache.Configuration than add it to the code? When you replace all these codes, was the spring session working btw?
Yes spring session was working fine with my changes. I thought having the SessionController.java
already there in the codebase vs having the user create it would be better since the REST API part of this exercise is not the focus - the configuration of the cache was the focus.
Also the cache configuration (methods with @Bean
annotations) belong in @Configuration
classes, not @Service
classes. That is why I moved them to a config
package inside a class called EmbeddedCacheConfig.java
with an @Configuration
annotation. With the @Configuration
annotation you would need to "spell-out" the fully-qualified class name for either the infinispan Configuration
class or the spring Configuration
class.
Coincides with RedHat-Middleware-Workshops/dg8-workshop-labs#1