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

de.muenchen.oss.digiwf.example.integration.streaming.Consumers Maven / Gradle / Ivy

There is a newer version: 1.7.2
Show newest version
package de.muenchen.oss.digiwf.example.integration.streaming;

import de.muenchen.oss.digiwf.message.process.impl.dto.BpmnErrorDto;
import de.muenchen.oss.digiwf.message.process.impl.dto.CorrelateMessageDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;

import java.util.function.Consumer;

/**
 * This class contains consumers to debug the integration.
 */
@Slf4j
@Component
public class Consumers {

    @Bean
    public Consumer> onBpmnErrorConsumer() {
        return message -> {
            log.warn("BPMN error: {}", message.toString());
        };
    }

    @Bean
    public Consumer> onIncidentConsumer() {
        return message -> {
            log.warn("Incident:  {}", message.toString());
        };
    }

    @Bean
    public Consumer> correlateMessageConsumer() {
        return message -> {
            log.info(message.getPayload().toString());
        };
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy