ActiveMQ

From Wikitech
Jump to navigation Jump to search

ActiveMQ used to be part of our fundraising architecture. It stood between civicrm and our operational cluster running the Donation Gateway extension providing a new payment gateway.

It lived on silicon, a former member of frack.eqiad.wmnet.

We have replaced it with Redis, running on frqueue1001. ActiveMQ had stability issues, crashing several times in the middle of important campaigns. In addition, we had been using it as a key-value store even though its architecture did not guarantee that all messages in the queue would be available by key (only those fresh enough to be in RAM). We use Redis strictly as a queue, and store messages needing key lookup in a 'pending' payments table.

The following was written when ActiveMQ was still a part of our operations.

Software

Currently we're running ActiveMQ 5.9.0 for our installation. The software needs to be puppetized but in the interim is located in /usr/local/apache-activemq, symlinked to the current version. The configuration is located in /etc/activemq.conf.

Configuration

Config files

There are two important config files for ActiveMQ:

  • /usr/local/apache-activemq/conf/actibemq.xml - This contains the specific conncetion information for activemq (eg defining transportConncetors). This gets loaded by activemq by default when activemq is invoked.
  • /etc/activemq.conf - This contains some environment variables for activemq

Connectors

<transportConnector name="stomp" uri="stomp://0.0.0.0:61613?transport.closeAsync=false"/>

Start/Stop

/etc/init.d/activemq {start|stop}

note: if stop doesn't work then just killall java

Escalation

Arthur

Activity

Check /var/log/activemq.log for what's going on.

or to view in a web browser:

Log in to tellurium. ex

ssh khorn@tellurium.wikimedia.org -L 4000:silicon.frack.eqiad.wmnet:8161

Login with your default terminal username

ssh tellurium.wikimedia.org -L 4000:silicon.frack.eqiad.wmnet:8161

Connect to ActiveMQ

http://localhost:4000/admin/queues.jsp

Testing donation consumption

  1. Follow the steps above to pull up the web interface.
  2. Under the "Operations" column click "Send to" for the "test_donations" queue.
  3. Insert a test message and click send. (The message body will consist of a JSON string. You can check the logs to see examples.)
  4. ssh to aluminium (or wherever civicrm-dev is running from).
  5. cd to the /srv/org.wikimedia.civicrm-dev directory
  6. run "drush qc" to consume the queue
  7. If there are no errors, log into https://civicrm-dev.wikimedia.org/civicrm/ and look for the donation.