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
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>
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>
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>
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
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
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.
All Things… Spring for Apache Geode
STDG
Example of Mocking Unsupported Cache/Region Operations & @EnableGemFireResourceCollector
SDG
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);
Perform basic CRUD, simple (OQL) Queries and Function Executions all conveniently from the Repository
OnRegion vs. [OnServer(s) | OnMember(s)]
SSDG
SBDG
GemFire/Geode Properties must be prefixed with “gemfire.”
Property precedence… last definition wins!
Warns user for invalid & unset properties
Use with Spring Profiles