MQ Consumer

Purpose

InstiHire uses RabbitMQ to distribute processing of background tasks, including indexing, batch jobs, and other long running processes. The mqconsumer component is responsible for processing all requests sent by the other parts of the system. Because of its distributed nature, any number of consumers can be run anywhere in the network that has access to the required queues.

The message queue is a key component in bridging the gaps between the old code base and the new. It made it possible to easily replace code in the current code base, with messaging commands that executed new code in the mqconsumer, which allows us a great deal of confidence that the new code isn’t breaking the system in unexpected ways.

$ bin/mqconsumer -help
usage: mqconsumer
 -help                 Print this help information
 -D <property=value>   use value for given property, eg -D
                       log4j.configuration=file:path/to/config
 -P <property=value>   use value for given property, specify env with -P
                       env=demo

Parameters

-help Display the help message above
-D Advanced: Used to override Java system properties for the program. Also used to override Tapestry Symbols.
-P Advanced: Actually set by the shell script, bin/batch-jobs to designate which environment the program is running in. This should not be overridden.

Tip

A helpful usage of this option is to add -Dhibernate.show_sql=true to any command, which will cause any SQL that is executed to be written to standard output.

Examples

$ # start the number of consumers configured for this node
$ bin/run-consumers

$ # stop all the consumers
$ bin/stop-consumers