crabhi / celery-java

Java implementation of Celery client and worker
MIT License
97 stars 29 forks source link

how to use redis for broker? #29

Open longpan opened 3 years ago

longpan commented 3 years ago

It seems that celery-java do not support the redis broker this is my code: ` Celery client = Celery.builder() .brokerUri("redis://:M2EzYmNiYzc3Y2IyZWFiNzRhMjkxOGU4ODJiY2YyOTJhOWVmMTQ5YjEwOGZkODFl@10.19.0.11:6379/3") // .backendUri("rpc://:M2EzYmNiYzc3Y2IyZWFiNzRhMjkxOGU4ODJiY2YyOTJhOWVmMTQ5YjEwOGZkODFl@10.19.0.11:6379/3") .build();

    try {

        System.out.println(client.submit("tasks.add", new Object[]{1, 2}).get());

// client.submit(TestTask.class, "sum", new Object[]{"a", "b"}).get(); } finally {

    }`

this is the errMsg: Exception in thread "main" com.geneea.celery.UnsupportedProtocolException: Unsupported protocol: redis. Supported protocols are: amqp, amqps at com.geneea.celery.brokers.CeleryBrokers.createBroker(CeleryBrokers.java:46) at com.geneea.celery.Celery.lambda$new$0(Celery.java:64) at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:160) at com.geneea.celery.Celery.submit(Celery.java:144) at com.caih.api.admin.utils.celery.CeleryUtils.main(CeleryUtils.java:30)

crabhi commented 3 years ago

Yes, that's true. It's implemented only for Rabbit broker.

On Thu, Dec 31, 2020, 07:58 longpan notifications@github.com wrote:

It seems that celery-java do not support the redis broker [image: image] https://user-images.githubusercontent.com/5399632/103398654-a61cdc00-4b78-11eb-9ae9-f4e7be5d8023.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/crabhi/celery-java/issues/29, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHX3TRM6RSODSVEXT4YECLSXQOK5ANCNFSM4VPEJATQ .

longpan commented 3 years ago

Thank you for your answer. By the way, is there a implement for redis broker ?