Repository navigation
Assembler v0.7.4
This release brings 2 new features:
- Support for Spring Caching, allowing the use of any caching implementation supported by the Spring Framework (example taken from demo project https://github.com/pellse/assembler-spring-graphql-example):
import org.springframework.cache.CacheManager;
import static io.github.pellse.assembler.caching.spring.SpringCacheFactory.springCache;
...
@Controller
public class SpO2MonitoringGraphQLController {
record SpO2Reading(SpO2 spO2, Patient patient, BodyMeasurement bodyMeasurement) {
}
private final Assembler<SpO2, SpO2Reading> spO2ReadingAssembler;
SpO2MonitoringGraphQLController(
PatientService ps,
BodyMeasurementService bms,
CacheManager cacheManager) {
final var patientCache = cacheManager.getCache("patientCache");
final var bodyMeasurementCache = cacheManager.getCache("bodyMeasurementCache");
spO2ReadingAssembler = assemblerOf(SpO2Reading.class)
.withCorrelationIdResolver(SpO2::patientId)
.withRules(
rule(Patient::id, oneToOne(cached(call(SpO2::healthCardNumber, ps::findPatientsByHealthCardNumber), springCache(patientCache)))),
rule(BodyMeasurement::patientId, oneToOne(cached(call(bms::getBodyMeasurements), springCache(bodyMeasurementCache)))),
SpO2Reading::new)
.build();
}
}- Ability to configure read and write non-blocking bounded queues in
ConcurrentCache