All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fr.fezlight.eventsystem.models.Handler Maven / Gradle / Ivy

Go to download

This library is dedicated for Spring Boot application and is an implementation of an event system integrated with RabbitMQ and Spring-Modulith-Events.

The newest version!
package fr.fezlight.eventsystem.models;

import static org.springframework.util.StringUtils.hasLength;

public record Handler(String name, EventHandler eventHandler) {
    public String condition() {
        return eventHandler.getSubscribeEvent().condition();
    }

    public int retry() {
        return eventHandler.getSubscribeEvent().retry();
    }

    public void handle(T event) {
        eventHandler.handle(event);
    }

    @Override
    public String name() {
        var customName = eventHandler.getSubscribeEvent().customName();
        if (hasLength(customName)) {
            return customName;
        }

        return name;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy