AMQP Message Queue

Invoice Lifecycle

  1. System 36 generates invoice and “prints” it
  2. Redmon intercepts that data by acting like a printer
  3. Custom C# tool RawUploader writes this data to a local database
  4. Custom C# tool DataQueueDispatcher uploads records from local database to CRM Printlog Raw table
  5. CRM takes Raw record and parses it into a CRM Invoice record
  6. CRM submits Invoice id and formats to be printed to AMQP message queue to be printed
  7. Custom C# tool PrintDaemon monitors AMQP message queue and spools any waiting records to the selected printer

We use a message queue, RabbitMQ, to store invoices waiting to be printed. The RabbitMQ daemon runs on Server20081 and publishes a queue called invoice. Print tools and the CRM interface with this queue with the credentials stored in KeePass.

Clear the Queue

In the case of certain errors the message queue may need to be cleared. You can do that by logging into the AMQP server and issuing the following command.

Note: Only unacknowledged messages can be cleared. So any queue monitoring programs should be stopped.

rabbitmqctl purge_queue <queue_name>

You can be sure the command worked by checking the queue status.

rabbitmqctl list_queues