ZeroMQ worker for backend components
The ZeroMQ worker is a standalone worker for backend components that use ZeroMQ. It takes care of deserialization and serialization of request and response objects. Go to our ZeroMQ page for more information concerning the flow here.
<dependency>
<groupId>de.metalcon</groupId>
<artifactId>zmq-worker</artifactId>
<version>0.2.1</version>
</dependency>
At first you have to create your request handler that implements ZeroMQRequestHandler
.
In the only method this interface promises, you get a deserialized object derived from Request
, defined in the backend API.
Check the request type via instanceof
and do your magic.
Finally you return a response object derived from Response
that will be sent to the client automatically.
In the main method of your component you create a new worker instance and start it by calling the start
-method.
The worker stops if a ShutdownRequest
, defined in the basic API, is received.