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

io.elastic.sailor.impl.ErrorCallback Maven / Gradle / Ivy

There is a newer version: 4.0.3
Show newest version
package io.elastic.sailor.impl;

import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import io.elastic.sailor.ErrorPublisher;
import io.elastic.sailor.ExecutionContext;

public class ErrorCallback extends CountingCallbackImpl {

    private ExecutionContext executionContext;
    private ErrorPublisher errorPublisher;

    @Inject
    public ErrorCallback(
            @Assisted ExecutionContext executionContext,
            ErrorPublisher errorPublisher) {
        this.executionContext = executionContext;
        this.errorPublisher = errorPublisher;
    }

    @Override
    public void receiveData(Object data) {
        this.errorPublisher.publish((Throwable) data, executionContext.buildAmqpProperties(), executionContext.getRawMessage());

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy