Processing Servers listen on the queue with the same name with the processor. For example, ocrd-dummy processors listen on ocrd-dummy queue.
The processing servers pull jobs from the queue, execute it, and update the status in the database.
To start the processing server, there are two ways:
# use ocrd tool
$ ocrd processing-server <processor-name> --queue=<queue-address> --database=<database-address>
# use processor name
$ <processor-name> processing-server --queue=<queue-address> --database=<database-address>
Fault tolerance
To increase fault tolerance, manual acknowledgement mode must be used. In this case,
if the processing finished successfully, send a positive ACK signal.
if the processing ended in failure, try again 3 times. If it's still failed, send a negative ACK signal to let the queuing system re-queue the message.
If there is no ACK received (e.g., consumer crash), the queuing system will automatically re-queue the message after timeout. By default, it's 30 minutes. This value might need to be adjusted to fit best to our use case.
Idempotence
If there is something wrong, e.g. network, the message will be sent again to the consumer. Make sure to check the redeliver property to make sure that we don't process a page twice.
Result
Processing servers write the results to the database. Depending on the value specified in the message body, it can decide if it needs to push the result to the message queue or not, and to which queue name.
Description
Processing Servers listen on the queue with the same name with the processor. For example,
ocrd-dummy
processors listen onocrd-dummy
queue.The processing servers pull jobs from the queue, execute it, and update the status in the database.
To start the processing server, there are two ways:
Fault tolerance
To increase fault tolerance, manual acknowledgement mode must be used. In this case,
If there is no ACK received (e.g., consumer crash), the queuing system will automatically re-queue the message after timeout. By default, it's 30 minutes. This value might need to be adjusted to fit best to our use case.
Idempotence
If there is something wrong, e.g. network, the message will be sent again to the consumer. Make sure to check the
redeliver
property to make sure that we don't process a page twice.Result
Processing servers write the results to the database. Depending on the value specified in the message body, it can decide if it needs to push the result to the message queue or not, and to which queue name.