Skip to content

Instantly share code, notes, and snippets.

@aaronschachter
Last active August 29, 2015 14:01
Show Gist options
  • Save aaronschachter/ca702e6c4f3e99044472 to your computer and use it in GitHub Desktop.
Save aaronschachter/ca702e6c4f3e99044472 to your computer and use it in GitHub Desktop.

Make sure you have an update to build. Either pull from stage or run ds build.

  1. Install Rabbit

If you have brew installed, http://www.rabbitmq.com/install-homebrew.html

Follow the steps for installing, adding to your .bash_profile and then you can run

rabbitmq-server

Locally, you can now access RabbitMQ at http://localhost:15672 guest/guest

You'll see tabs for Exchanges and Queues.

An Exchange ties the Queues together. If you want to send a messag,e you send directly to an Exchange, not a Queue.

An app called a Producer sends messages to an Exchange. that exchange takes care of the distribution of the message ot th equeus attached to it.

Producers and Consumers use settings to set up and access the Queues

@aaronschachter
Copy link
Author

  1. Setting up queue for Zendesk

All settings happen at the file level, so for a new Queue for Zendesk, we'll add an entry in the message_broker_producer module. This is not the ideal setup, but needed to get Drupal to join the team.** (add more details here later)

We'll also need matching settings in the mb-config.inc, which is the messagebroker_config repo.

https://github.com/DoSomething/messagebroker-config/blob/master/mb-config.inc
-- This is where you add a new queue for both Consumer (and a non-drupal Producer).
-- For Drupal, we are adding the queue for the drupal producer in message_broker_producer.module. These can be seen in the UI at admin/config/services/message-broker-producer/mq-settings, underneath Producer Configuration > Queues

@aaronschachter
Copy link
Author

In message_broker_producer.module > message_broker_producer_request, add a new queue into the $config array.
e.g.

$config['queue']['registrations']
$config['queue']['campaign_signups']

so we'll create a new queue
$config['queue']['zendesk']

@aaronschachter
Copy link
Author

Currently there are 2 production types: Produce Transactional, Campaign cache.

So we need a new production type: Produce Help Ticket.

A production type is an exchange.

Only through code, you create a new exchange.

I'll need one queue to submit a ticket. (for future dev: create separate exchange/queue for creating a ZD user)

Topic Exchange can distribute messages to different queues based on keys / wildcard settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment