crabhi / celery-java

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

When Java client calls Java worker, can the worker be deployed on a server separately and not on the same server with Java client? #21

Closed zibinwang closed 4 years ago

zibinwang commented 4 years ago

When Java client calls Java worker, can the worker be deployed on a server separately and not on the same server with Java client?

crabhi commented 4 years ago

I think yes. It should be independent and communicate via message broker. I haven't needed it, though so it's not much tested.

zibinwang commented 4 years ago

When Java client calls Java worker, it needs the agent class of worker as the parameter. However, since worker and client are deployed on different servers, how does the client get the agent class of worker?

I think yes. It should be independent and communicate via message broker. I haven't needed it, though so it's not much tested.

When Java client calls Java worker, it needs the agent class of worker as the parameter. However, since worker and client are deployed on different servers, how does the client get the agent class of worker?

crabhi commented 4 years ago

They just need to share the code. The class describes the API of the task and makes it easier to call the task from your code.

Check the Celery#submit method. It just extracts the name from the class. If you really don't want to share the classes, you can use the Celery#submit(String, Object[]) method.