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

pl.wrzasq.commons.aws.sqs.EventHandler Maven / Gradle / Ivy

// Generated by delombok at Wed Mar 25 03:28:41 UTC 2020
/*
 * This file is part of the pl.wrzasq.commons.
 *
 * @license http://mit-license.org/ The MIT license
 * @copyright 2019 © by Rafał Wrzeszcz - Wrzasq.pl.
 */
package pl.wrzasq.commons.aws.sqs;

import java.util.function.Consumer;
import com.amazonaws.services.lambda.runtime.events.SQSEvent;

/**
 * SQS incoming event handler.
 */
public class EventHandler {
    /**
     * Message consumer.
     */
    private Consumer messageHandler;

    /**
     * Processes event message.
     *
     * @param event SQS message event message.
     */
    public void process(SQSEvent event) {
        // SNS event for lambda always contain one record, but keep it uniform
        event.getRecords().forEach(this.messageHandler);
    }

    @SuppressWarnings("all")
    @lombok.Generated
    public EventHandler(final Consumer messageHandler) {
        this.messageHandler = messageHandler;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy