com.geneea.celery.backends.rabbit.RabbitResultConsumer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of celery-java Show documentation
Show all versions of celery-java Show documentation
Java library for interfacing with http://celeryproject.org including code for both task submissions and task
execution.
package com.geneea.celery.backends.rabbit;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.DefaultConsumer;
import com.rabbitmq.client.Envelope;
import com.geneea.celery.WorkerException;
import com.geneea.celery.backends.TaskResult;
import javax.annotation.Nonnull;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.TimeUnit;
class RabbitResultConsumer extends DefaultConsumer implements RabbitBackend.ResultsProvider {
private final LoadingCache> tasks =
CacheBuilder
.newBuilder()
.expireAfterWrite(2, TimeUnit.HOURS)
.build(new CacheLoader>() {
@Override
public SettableFuture
© 2015 - 2025 Weber Informatics LLC | Privacy Policy