io.kestra.runner.h2.H2WorkerTriggerResultQueue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jdbc-h2 Show documentation
Show all versions of jdbc-h2 Show documentation
The modern, scalable orchestrator & scheduler open source platform
package io.kestra.runner.h2;
import io.kestra.core.exceptions.DeserializationException;
import io.kestra.core.queues.WorkerTriggerResultQueueInterface;
import io.kestra.core.runners.WorkerTriggerResult;
import io.kestra.core.utils.Either;
import io.kestra.jdbc.JdbcWorkerTriggerResultQueueService;
import io.micronaut.context.ApplicationContext;
import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
import java.util.function.Consumer;
@Slf4j
public class H2WorkerTriggerResultQueue extends H2Queue implements WorkerTriggerResultQueueInterface {
private final JdbcWorkerTriggerResultQueueService jdbcWorkerTriggerResultQueueService;
public H2WorkerTriggerResultQueue(ApplicationContext applicationContext) {
super(WorkerTriggerResult.class, applicationContext);
this.jdbcWorkerTriggerResultQueueService = applicationContext.getBean(JdbcWorkerTriggerResultQueueService.class);
}
@Override
public Runnable receive(String consumerGroup, Class> queueType, Consumer> consumer) {
return jdbcWorkerTriggerResultQueueService.receive(consumerGroup, queueType, consumer);
}
@Override
public void close() throws IOException {
super.close();
jdbcWorkerTriggerResultQueueService.close();
}
}