SlideShare a Scribd company logo
1 of 40
The Past Year in
Spring for Apache Geode
September 2–3, 2020
springone.io
John Blum
Lead…
for (P project : Spring for Apache Geode) {
manage(project);
}
@john_blum
…
Spring for Apache GeodeAll things…
What things?
Spring Boot
Spring Data Spring Session
Spring Test
Spring Boot
Spring Data Spring Session
Spring Test
Spring Boot Spring Data Spring Session Spring Test
TDP
(Test-Driven Presentation)
Spring Test for Apache Geode <STDG/>
 Fine-grained control over GemFire/Geode Mock Object Lifecycle [doc]
 Mocking Unsupported Cache Operations [doc]
 New @EnableGemFireResourceCollector [doc]
GemFire/Geode Mock Object Lifecycle
@EnableGemFireMockObjects(destroyOnEvents = { … })
class TestGeodeConfiguration {
…
}
Any event class in package org.springframework.test.context.event
 E.g. AfterTestMethodEvent
 Defaults to AfterTestClassEvent
EXAMPLE
Mocking Unsupported Cache Operations & @EnableGemFireResourceCollector
How To Use Spring Test with Apache Geode
 Generate Spring Boot [SBDG] project at start.spring.io
 Include spring-geode-starter-test module
<dependencies>
<dependency>
<groupId>org.springframework.geode</groupId>
<artifactId>spring-geode-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Spring Boot Spring Data Spring Session Spring Test
Spring Data for Apache Geode <SDG/>
 DATAGEODE-238 – spring-data-gemfire module
 DATAGEODE-272 – TransactionListener event publishing
 DATAGEODE-152 [Doc]
 WIP: DATAGEODE-263 – Paging
 WIP: DATAGEODE-262 – Projections
 WIP: DATAGEODE-258 – Function Executions on Region from Repository
Manual Transaction Event Publishing
@Service
class MyTransactionalService {
@Autowired
ApplicationEventPublisher publisher;
@Transactional
public void someTransactionalMethod() {
try {
// do transaction
publisher.publish(new CommitEvent());
} catch (DataAccessException e) {
publisher.publish(new RollbackEvent(e));
throw e;
}
}
@Component
class MyTransactionEventListeners {
@TransactionalEventListener(phase =
TransactionPhase.AFTER_COMMIT)
public void onCommit(CommitEvent event) {
// handle commit
}
@TransactionalEventListener(phase =
TransactionPhase.AFTER_ROLLBACK)
public void onRollback(RollbackEvent event) {
// handle rollback
}
}
https://spring.io/blog/2015/02/11/better-application-events-in-spring-framework-4-2
@Configuration
@EnableGemfireCacheTransactions
class GeodeConfiguration { }
Auto Transaction Event Publishing
@Service
class MyTransactionalService {
@Transactional
public void someTransactionalMethod() {
// do transaction
}
}
@Component
class MyTransactionEventListeners {
@TransactionalEventListener(phase =
TransactionPhase.AFTER_COMMIT)
public void onCommit(
TransactionApplicationEvent event) {
// handle commit
}
@TransactionalEventListener(phase =
TransactionPhase.AFTER_ROLLBACK)
public void onRollback(
TransactionApplicationEvent event) {
// handle rollback
}
}
https://docs.spring.io/spring-data/geode/docs/current/reference/html/#apis:auto-transaction-event-publishing
@Configuration
@EnableGemfireCacheTransactions(
enableAutoTransactionEventPublishing =
true)
class GeodeConfiguration { }
Projections, Paging & OnRegion Function Executions
interface UserRepository extends CrudRepository<User, String> {
// Projection (User -> UserView)
UserView findByNameLike(String wildcardName, Sort orderBy);
// Paging (Page number, Page size & Sort)
List<User> findByNameLike(String wildcardName, Pageable pageRequest);
Page<UserView> findByNameLike(String wildcardName, Pageable pageRequest);
@Function
boolean grant(Set<Long> userIds, Role role);
}
https://docs.spring.io/spring-data/data-commons/docs/current/reference/html/#repositories.paging-and-sorting
@Region(“Users”)
class User {
@Id
Long id;
String name;
Role role;
LocalDateTime lastAccessTime;
boolean active;
}
class UserView {
String name;
LocalDateTime lastAccessTime;
}
OnRegion Function Execution
interface UserRepository extends CrudRepository<User, Long> {
@Function
boolean grant(Set<Long> userIds, Role role);
}
@OnRegion(region = “Users”)
interface UserFunctions {
boolean grant(Set<Long> ids, Role role);
}
~=
How To Use Spring Data with Apache Geode
 Generate Spring Boot [SBDG] project at start.spring.io
 spring-geode-starter module (provided)
<dependencies>
<dependency>
<groupId>org.springframework.geode</groupId>
<artifactId>spring-geode-starter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Spring Boot Spring Data Spring Session Spring Test
Spring Session for Apache Geode <SSDG/>
 New Spring Profile to disable OQL Indexes created by SSDG
 “disable-spring-session-data-gemfire-indexes”
 Principle Name & Session Attributes Indexes
 HASH OQL Indexes changed to RANGE/FUNCTION OQL Indexes
 Marks identity field (id) of Session object when using PDX Serialization
How To Use Spring Session with Apache Geode
 Generate Spring Boot [SBDG] project at start.spring.io
 Include spring-geode-starter-session module
<dependencies>
<dependency>
<groupId>org.springframework.geode</groupId>
<artifactId>spring-geode-starter-session</artifactId>
</dependency>
</dependencies>
Spring Boot Spring Data Spring Session Spring Test
Spring Boot for Apache Geode <SBDG/>
 Asynchronous (Write-Behind) Inline Caching [doc]
 Cache Initialization, i.e. loading Data using JSON [doc]
 Support for gemfire.properties in Spring Boot
application.properties [doc]
Patterns of Caching
 Look-Aside Caching *
 Inline Caching
 Sync or Async
 Near Caching
 Multi-Site Caching
 Active-Active or Active-Passive
Patterns of Caching
 Look-Aside Caching *
 Inline Caching
 Sync or Async
 Near Caching
 Multi-Site Caching
 Active-Active or Active-Passive
Use Cases of Caching
 (HTTP) Session Caching
 Hibernate L2 Caching
 Etc.
Inline Caching
Inline Caching
CREATE/UPDATE
Cache Put
Write-Through [sync]
Write-Behind [async]
READ
Cache Get
Read-Through [sync]
.
.
.
.
.
.
.
.
.
.
.
.
Inline Caching
Write-Through [sync]
Write-Behind [async]
Read-Through [sync]
Inline Caching
CacheWriter
CacheLoader
Read-Through [sync]
Write-Through [sync]
Write-Behind [async]
Inline Caching
Write-Through [sync]
Write-Behind [async]
Read-Through [sync]
CacheLoaderAsyncEventListener
Inline Caching Applied
@Service
class UserService {
@Cacheable(“UsersByName”)
User findBy(String name) {
…
}
}
Synchronous (Read/Write-Through) Inline Caching
@Configuration
@EnableCachingDefinedRegions
class GeodeConfiguration {
@Bean
InlineCachingRegionConfigurer<User, Long> syncInlineCachingConfigurer(
UserRepository userRepository) {
return new InlineCachingRegionConfigurer(userRepository, “Users”);
}
}
Asynchronous (Write-Behind) Inline Caching
@Configuration
@EnableCachingDefinedRegions
class GeodeConfiguration {
@Bean
AsyncInlineCachingRegionConfigurer<User, Long> asyncInlineCachingConfigurer(
UserRepository userRepository) {
return AsyncInlineCachingRegionConfigurer.create(userRepository, “Users”)
.withQueueBatchConflationEnabled()
.withQueueBatchSize(50)
.withQueueBatchTimeInterval(Duration.ofSeconds(30))
}
} @Bean
RepositoryCacheLoaderRegionConfigurer<User, Long> syncInlineCachingConfigurer(
UserRepository userRepository) {
return new RepositoryCacheLoaderRegionConfigurer(userRepository, “Users”)
}
}
// Write-Behind
// Read-Through
gemfire.properties in application.properties
# Spring Boot application.properties
server.port=8181
spring.application.name=SpringGeodeApplication
gemfire.durable-client-id=123
gemfire.enable-time-statistics=${external-enable-stats:true}
spring.data.gemfire.cache.client.durable-client-id=987
https://docs.spring.io/spring-boot-data-geode-build/1.4.x/reference/html5/index.html#geode-configuration-
gemfire-properties
EXAMPLE
Cache Initialization
Spring Boot for Apache Geode <SBDG/>
 New Multi-Site Caching Example & Guide [doc / source]
 New Security Example & Guide [doc / source]
 Auto-configuration for TLS/SSL On-platform [doc]
 PCF/PCC  VMware Tanzu GemFire for VMs (BOSH)
 New Using Apache Geode with Docker chapter [doc]
 New Apache Geode API Extensions chapter [doc]
 New spring-geode-starter-logging module [doc]
 New spring-geode-bom module [Issue #93]
How To Use Spring Boot with Apache Geode
 Generate Spring Boot [SBDG] project at start.spring.io
 spring-geode-starter module (provided)
<dependencies>
<dependency>
<groupId>org.springframework.geode</groupId>
<artifactId>spring-geode-starter</artifactId>
</dependency>
</dependencies>
References
 Spring Data for Apache Geode (SDG) [ Project | Source | JIRA | PR ]
 Spring Test for Apache Geode (STDG) [ | Source | Issues | PR ]
 Spring Session for Apache Geode (SSDG) [ Project | Source | Issues | PR ]
 Spring Boot for Apache Geode (SBDG) [ | Source | Issues | PR ]
 StackOverflow
 Examples
Stay Connected.
A Deep Dive into Spring Application Events
By Oliver Drotbohm
Wed, Sept 2 @ 1:05 PM PDT
#springone@s1p
Safe Harbor Statement
ThefollowingisintendedtooutlinethegeneraldirectionofVMware'sofferings.Itisintendedforinformationpurposesonlyandmay notbeincorporated
intoanycontract. Anyinformationregardingpre-releaseofVMwareofferings,futureupdatesorotherplannedmodificationsis subjecttoongoing
evaluationbyVMwareandissubjecttochange.Thisinformationisprovidedwithoutwarrantyoranykind, expressorimplied, and isnotacommitmentto
deliveranymaterial,code,orfunctionality,and shouldnotberelieduponin makingpurchasingdecisionsregardingVMware's offerings.Thesepurchasing
decisionsshould onlybebasedon featurescurrentlyavailable. Thedevelopment,release,and timingofanyfeaturesorfunctionalitydescribedfor
VMware'sofferingsin thispresentationremainatthesolediscretionofPivotal. Pivotalhasnoobligationtoupdateforwardlookinginformationin this
presentation.
4
2

More Related Content

What's hot

Dropwizard and Friends
Dropwizard and FriendsDropwizard and Friends
Dropwizard and FriendsYun Zhi Lin
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot IntroductionJeevesh Pandey
 
Dropwizard Spring - the perfect Java REST server stack
Dropwizard Spring - the perfect Java REST server stackDropwizard Spring - the perfect Java REST server stack
Dropwizard Spring - the perfect Java REST server stackJacek Furmankiewicz
 
Spring boot for buidling microservices
Spring boot for buidling microservicesSpring boot for buidling microservices
Spring boot for buidling microservicesNilanjan Roy
 
Managing user's data with Spring Session
Managing user's data with Spring SessionManaging user's data with Spring Session
Managing user's data with Spring SessionDavid Gómez García
 
Spring Boot & WebSocket
Spring Boot & WebSocketSpring Boot & WebSocket
Spring Boot & WebSocketMing-Ying Wu
 
Spring Boot and Microservices
Spring Boot and MicroservicesSpring Boot and Microservices
Spring Boot and Microservicesseges
 
Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Matt Raible
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootJosué Neis
 
Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC Naresh Chintalcheru
 
Spring boot - an introduction
Spring boot - an introductionSpring boot - an introduction
Spring boot - an introductionJonathan Holloway
 
How to customize Spring Boot?
How to customize Spring Boot?How to customize Spring Boot?
How to customize Spring Boot?GilWon Oh
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudBen Wilcock
 

What's hot (20)

JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter LehtoJavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
 
Dropwizard and Friends
Dropwizard and FriendsDropwizard and Friends
Dropwizard and Friends
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 
Springboot Microservices
Springboot MicroservicesSpringboot Microservices
Springboot Microservices
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Dropwizard Spring - the perfect Java REST server stack
Dropwizard Spring - the perfect Java REST server stackDropwizard Spring - the perfect Java REST server stack
Dropwizard Spring - the perfect Java REST server stack
 
Spring boot for buidling microservices
Spring boot for buidling microservicesSpring boot for buidling microservices
Spring boot for buidling microservices
 
Managing user's data with Spring Session
Managing user's data with Spring SessionManaging user's data with Spring Session
Managing user's data with Spring Session
 
Spring Boot & WebSocket
Spring Boot & WebSocketSpring Boot & WebSocket
Spring Boot & WebSocket
 
Spring Boot and Microservices
Spring Boot and MicroservicesSpring Boot and Microservices
Spring Boot and Microservices
 
Microservices/dropwizard
Microservices/dropwizardMicroservices/dropwizard
Microservices/dropwizard
 
Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
 
Spring boot - an introduction
Spring boot - an introductionSpring boot - an introduction
Spring boot - an introduction
 
Spring4 whats up doc?
Spring4 whats up doc?Spring4 whats up doc?
Spring4 whats up doc?
 
How to customize Spring Boot?
How to customize Spring Boot?How to customize Spring Boot?
How to customize Spring Boot?
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloud
 

Similar to The Past Year in Spring for Apache Geode

Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)Red Hat Developers
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasyJBug Italy
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android InfrastructureAlexey Buzdin
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android InfrastructureC.T.Co
 
Annotation processing and code gen
Annotation processing and code genAnnotation processing and code gen
Annotation processing and code genkoji lin
 
DWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A TutorialDWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A Tutorialjbarciauskas
 
Groovy - Grails as a modern scripting language for Web applications
Groovy - Grails as a modern scripting language for Web applicationsGroovy - Grails as a modern scripting language for Web applications
Groovy - Grails as a modern scripting language for Web applicationsIndicThreads
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web servicesnbuddharaju
 
GraphTour - Utilizing Powerful Extensions for Analytics & Operations
GraphTour - Utilizing Powerful Extensions for Analytics & OperationsGraphTour - Utilizing Powerful Extensions for Analytics & Operations
GraphTour - Utilizing Powerful Extensions for Analytics & OperationsNeo4j
 
Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Murat Yener
 
Neo4j GraphTour: Utilizing Powerful Extensions for Analytics and Operations
Neo4j GraphTour: Utilizing Powerful Extensions for Analytics and OperationsNeo4j GraphTour: Utilizing Powerful Extensions for Analytics and Operations
Neo4j GraphTour: Utilizing Powerful Extensions for Analytics and OperationsMark Needham
 
REST made simple with Java
REST made simple with JavaREST made simple with Java
REST made simple with Javaelliando dias
 

Similar to The Past Year in Spring for Apache Geode (20)

RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
 
Codemotion appengine
Codemotion appengineCodemotion appengine
Codemotion appengine
 
Spring boot
Spring boot Spring boot
Spring boot
 
Ejb3 Dan Hinojosa
Ejb3 Dan HinojosaEjb3 Dan Hinojosa
Ejb3 Dan Hinojosa
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
Annotation processing and code gen
Annotation processing and code genAnnotation processing and code gen
Annotation processing and code gen
 
DWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A TutorialDWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A Tutorial
 
Groovy - Grails as a modern scripting language for Web applications
Groovy - Grails as a modern scripting language for Web applicationsGroovy - Grails as a modern scripting language for Web applications
Groovy - Grails as a modern scripting language for Web applications
 
Android best practices
Android best practicesAndroid best practices
Android best practices
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web services
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
GraphTour - Utilizing Powerful Extensions for Analytics & Operations
GraphTour - Utilizing Powerful Extensions for Analytics & OperationsGraphTour - Utilizing Powerful Extensions for Analytics & Operations
GraphTour - Utilizing Powerful Extensions for Analytics & Operations
 
Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15
 
Neo4j GraphTour: Utilizing Powerful Extensions for Analytics and Operations
Neo4j GraphTour: Utilizing Powerful Extensions for Analytics and OperationsNeo4j GraphTour: Utilizing Powerful Extensions for Analytics and Operations
Neo4j GraphTour: Utilizing Powerful Extensions for Analytics and Operations
 
REST made simple with Java
REST made simple with JavaREST made simple with Java
REST made simple with Java
 
REST made simple with Java
REST made simple with JavaREST made simple with Java
REST made simple with Java
 

More from VMware Tanzu

What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItVMware Tanzu
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023VMware Tanzu
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleVMware Tanzu
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023VMware Tanzu
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductVMware Tanzu
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready AppsVMware Tanzu
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And BeyondVMware Tanzu
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfVMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023VMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023VMware Tanzu
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptxVMware Tanzu
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchVMware Tanzu
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishVMware Tanzu
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVMware Tanzu
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - FrenchVMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023VMware Tanzu
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootVMware Tanzu
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerVMware Tanzu
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeVMware Tanzu
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsVMware Tanzu
 

More from VMware Tanzu (20)

What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About It
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at Scale
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a Product
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptx
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - French
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - English
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - French
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software Engineer
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs Practice
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
 

Recently uploaded

Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 

Recently uploaded (20)

Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 

The Past Year in Spring for Apache Geode

  • 1. The Past Year in Spring for Apache Geode September 2–3, 2020 springone.io
  • 2. John Blum Lead… for (P project : Spring for Apache Geode) { manage(project); } @john_blum
  • 3. … Spring for Apache GeodeAll things… What things?
  • 4. Spring Boot Spring Data Spring Session Spring Test
  • 5. Spring Boot Spring Data Spring Session Spring Test
  • 6. Spring Boot Spring Data Spring Session Spring Test TDP (Test-Driven Presentation)
  • 7. Spring Test for Apache Geode <STDG/>  Fine-grained control over GemFire/Geode Mock Object Lifecycle [doc]  Mocking Unsupported Cache Operations [doc]  New @EnableGemFireResourceCollector [doc]
  • 8. GemFire/Geode Mock Object Lifecycle @EnableGemFireMockObjects(destroyOnEvents = { … }) class TestGeodeConfiguration { … } Any event class in package org.springframework.test.context.event  E.g. AfterTestMethodEvent  Defaults to AfterTestClassEvent
  • 9. EXAMPLE Mocking Unsupported Cache Operations & @EnableGemFireResourceCollector
  • 10. How To Use Spring Test with Apache Geode  Generate Spring Boot [SBDG] project at start.spring.io  Include spring-geode-starter-test module <dependencies> <dependency> <groupId>org.springframework.geode</groupId> <artifactId>spring-geode-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies>
  • 11. Spring Boot Spring Data Spring Session Spring Test
  • 12. Spring Data for Apache Geode <SDG/>  DATAGEODE-238 – spring-data-gemfire module  DATAGEODE-272 – TransactionListener event publishing  DATAGEODE-152 [Doc]  WIP: DATAGEODE-263 – Paging  WIP: DATAGEODE-262 – Projections  WIP: DATAGEODE-258 – Function Executions on Region from Repository
  • 13.
  • 14. Manual Transaction Event Publishing @Service class MyTransactionalService { @Autowired ApplicationEventPublisher publisher; @Transactional public void someTransactionalMethod() { try { // do transaction publisher.publish(new CommitEvent()); } catch (DataAccessException e) { publisher.publish(new RollbackEvent(e)); throw e; } } @Component class MyTransactionEventListeners { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void onCommit(CommitEvent event) { // handle commit } @TransactionalEventListener(phase = TransactionPhase.AFTER_ROLLBACK) public void onRollback(RollbackEvent event) { // handle rollback } } https://spring.io/blog/2015/02/11/better-application-events-in-spring-framework-4-2 @Configuration @EnableGemfireCacheTransactions class GeodeConfiguration { }
  • 15. Auto Transaction Event Publishing @Service class MyTransactionalService { @Transactional public void someTransactionalMethod() { // do transaction } } @Component class MyTransactionEventListeners { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void onCommit( TransactionApplicationEvent event) { // handle commit } @TransactionalEventListener(phase = TransactionPhase.AFTER_ROLLBACK) public void onRollback( TransactionApplicationEvent event) { // handle rollback } } https://docs.spring.io/spring-data/geode/docs/current/reference/html/#apis:auto-transaction-event-publishing @Configuration @EnableGemfireCacheTransactions( enableAutoTransactionEventPublishing = true) class GeodeConfiguration { }
  • 16. Projections, Paging & OnRegion Function Executions interface UserRepository extends CrudRepository<User, String> { // Projection (User -> UserView) UserView findByNameLike(String wildcardName, Sort orderBy); // Paging (Page number, Page size & Sort) List<User> findByNameLike(String wildcardName, Pageable pageRequest); Page<UserView> findByNameLike(String wildcardName, Pageable pageRequest); @Function boolean grant(Set<Long> userIds, Role role); } https://docs.spring.io/spring-data/data-commons/docs/current/reference/html/#repositories.paging-and-sorting @Region(“Users”) class User { @Id Long id; String name; Role role; LocalDateTime lastAccessTime; boolean active; } class UserView { String name; LocalDateTime lastAccessTime; }
  • 17. OnRegion Function Execution interface UserRepository extends CrudRepository<User, Long> { @Function boolean grant(Set<Long> userIds, Role role); } @OnRegion(region = “Users”) interface UserFunctions { boolean grant(Set<Long> ids, Role role); } ~=
  • 18. How To Use Spring Data with Apache Geode  Generate Spring Boot [SBDG] project at start.spring.io  spring-geode-starter module (provided) <dependencies> <dependency> <groupId>org.springframework.geode</groupId> <artifactId>spring-geode-starter</artifactId> <scope>test</scope> </dependency> </dependencies>
  • 19. Spring Boot Spring Data Spring Session Spring Test
  • 20. Spring Session for Apache Geode <SSDG/>  New Spring Profile to disable OQL Indexes created by SSDG  “disable-spring-session-data-gemfire-indexes”  Principle Name & Session Attributes Indexes  HASH OQL Indexes changed to RANGE/FUNCTION OQL Indexes  Marks identity field (id) of Session object when using PDX Serialization
  • 21. How To Use Spring Session with Apache Geode  Generate Spring Boot [SBDG] project at start.spring.io  Include spring-geode-starter-session module <dependencies> <dependency> <groupId>org.springframework.geode</groupId> <artifactId>spring-geode-starter-session</artifactId> </dependency> </dependencies>
  • 22. Spring Boot Spring Data Spring Session Spring Test
  • 23. Spring Boot for Apache Geode <SBDG/>  Asynchronous (Write-Behind) Inline Caching [doc]  Cache Initialization, i.e. loading Data using JSON [doc]  Support for gemfire.properties in Spring Boot application.properties [doc]
  • 24. Patterns of Caching  Look-Aside Caching *  Inline Caching  Sync or Async  Near Caching  Multi-Site Caching  Active-Active or Active-Passive
  • 25. Patterns of Caching  Look-Aside Caching *  Inline Caching  Sync or Async  Near Caching  Multi-Site Caching  Active-Active or Active-Passive Use Cases of Caching  (HTTP) Session Caching  Hibernate L2 Caching  Etc. Inline Caching
  • 26. Inline Caching CREATE/UPDATE Cache Put Write-Through [sync] Write-Behind [async] READ Cache Get Read-Through [sync] . . . . . . . . . . . .
  • 29. Inline Caching Write-Through [sync] Write-Behind [async] Read-Through [sync] CacheLoaderAsyncEventListener
  • 30. Inline Caching Applied @Service class UserService { @Cacheable(“UsersByName”) User findBy(String name) { … } }
  • 31. Synchronous (Read/Write-Through) Inline Caching @Configuration @EnableCachingDefinedRegions class GeodeConfiguration { @Bean InlineCachingRegionConfigurer<User, Long> syncInlineCachingConfigurer( UserRepository userRepository) { return new InlineCachingRegionConfigurer(userRepository, “Users”); } }
  • 32. Asynchronous (Write-Behind) Inline Caching @Configuration @EnableCachingDefinedRegions class GeodeConfiguration { @Bean AsyncInlineCachingRegionConfigurer<User, Long> asyncInlineCachingConfigurer( UserRepository userRepository) { return AsyncInlineCachingRegionConfigurer.create(userRepository, “Users”) .withQueueBatchConflationEnabled() .withQueueBatchSize(50) .withQueueBatchTimeInterval(Duration.ofSeconds(30)) } } @Bean RepositoryCacheLoaderRegionConfigurer<User, Long> syncInlineCachingConfigurer( UserRepository userRepository) { return new RepositoryCacheLoaderRegionConfigurer(userRepository, “Users”) } } // Write-Behind // Read-Through
  • 33. gemfire.properties in application.properties # Spring Boot application.properties server.port=8181 spring.application.name=SpringGeodeApplication gemfire.durable-client-id=123 gemfire.enable-time-statistics=${external-enable-stats:true} spring.data.gemfire.cache.client.durable-client-id=987 https://docs.spring.io/spring-boot-data-geode-build/1.4.x/reference/html5/index.html#geode-configuration- gemfire-properties
  • 35. Spring Boot for Apache Geode <SBDG/>  New Multi-Site Caching Example & Guide [doc / source]  New Security Example & Guide [doc / source]  Auto-configuration for TLS/SSL On-platform [doc]  PCF/PCC  VMware Tanzu GemFire for VMs (BOSH)  New Using Apache Geode with Docker chapter [doc]  New Apache Geode API Extensions chapter [doc]  New spring-geode-starter-logging module [doc]  New spring-geode-bom module [Issue #93]
  • 36. How To Use Spring Boot with Apache Geode  Generate Spring Boot [SBDG] project at start.spring.io  spring-geode-starter module (provided) <dependencies> <dependency> <groupId>org.springframework.geode</groupId> <artifactId>spring-geode-starter</artifactId> </dependency> </dependencies>
  • 37. References  Spring Data for Apache Geode (SDG) [ Project | Source | JIRA | PR ]  Spring Test for Apache Geode (STDG) [ | Source | Issues | PR ]  Spring Session for Apache Geode (SSDG) [ Project | Source | Issues | PR ]  Spring Boot for Apache Geode (SBDG) [ | Source | Issues | PR ]  StackOverflow  Examples
  • 38. Stay Connected. A Deep Dive into Spring Application Events By Oliver Drotbohm Wed, Sept 2 @ 1:05 PM PDT #springone@s1p
  • 39.
  • 40. Safe Harbor Statement ThefollowingisintendedtooutlinethegeneraldirectionofVMware'sofferings.Itisintendedforinformationpurposesonlyandmay notbeincorporated intoanycontract. Anyinformationregardingpre-releaseofVMwareofferings,futureupdatesorotherplannedmodificationsis subjecttoongoing evaluationbyVMwareandissubjecttochange.Thisinformationisprovidedwithoutwarrantyoranykind, expressorimplied, and isnotacommitmentto deliveranymaterial,code,orfunctionality,and shouldnotberelieduponin makingpurchasingdecisionsregardingVMware's offerings.Thesepurchasing decisionsshould onlybebasedon featurescurrentlyavailable. Thedevelopment,release,and timingofanyfeaturesorfunctionalitydescribedfor VMware'sofferingsin thispresentationremainatthesolediscretionofPivotal. Pivotalhasnoobligationtoupdateforwardlookinginformationin this presentation. 4 2

Editor's Notes

  1. I am a member of the Spring Data Team and My responsibilities lie at the intersection of all things Spring for Apache Geode here at VMware. We will be covering a lot of content during this session and moving really fast in a short amount of time (25 minutes). I assume you know the basic Spring and Apache Geode concepts.
  2. All Things… Spring for Apache Geode
  3. STDG
  4. Example of Mocking Unsupported Cache/Region Operations & @EnableGemFireResourceCollector
  5. SDG
  6. SELECT entry.key FROM /Users.entries entry WHERE name LIKE ‘%doe’ ORDER BY entry.value.lastAccessTime DESC Execute OQL Query in Function for PARTITION Region usersRegions.getAll(keys);
  7. Perform basic CRUD, simple (OQL) Queries and Function Executions all conveniently from the Repository OnRegion vs. [OnServer(s) | OnMember(s)]
  8. SSDG
  9. SBDG
  10. GemFire/Geode Properties must be prefixed with “gemfire.” Property precedence… last definition wins! Warns user for invalid & unset properties Use with Spring Profiles
  11. Cache Initialization – loading Data using JSON