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

forklift.replay.ReplayConsumer Maven / Gradle / Ivy

There is a newer version: 3.8
Show newest version
package forklift.replay;

import forklift.decorators.Message;
import forklift.decorators.OnMessage;
import forklift.decorators.OnValidate;
import forklift.decorators.Queue;

import javax.inject.Inject;

@Queue("forklift.replay.es?consumer.exclusive=true")
public class ReplayConsumer {
    @Inject private ReplayESWriter writer;
    @Message private ReplayESWriterMsg msg;

    @OnValidate
    public boolean onValidate() {
        return this.writer != null && this.msg != null;
    }

    @OnMessage
    public void onMessage() {
        long start = System.currentTimeMillis();
        this.writer.poll(msg);
        System.out.println(System.currentTimeMillis() - start);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy