1. Edit page.js
2. Add the message queue javascript library

    OpenForum.loadScript("/OpenForum/MessageQueue/MessageQueue.js");

3. Set up queue polling

    var queueName = "my-queue-name";
    var queue;

    OpenForum.init = function() {
      queue = new MessageQueue(queueName);

      timer = setInterval( queue.pull , 1000 );
    };

4. Create a queue processor

    var queueName = "my-queue-name";
    var queue;

    OpenForum.init = function() {
      queue = new MessageQueue(queueName);

      queue.processMessages = function(messages) {
        for(var i=0; i< messages.length; i++) {
              processMessage(messages<a href="/OpenForum/Editor?pageName=/OpenForumDocumentation/CookBook/AddAQueueServiceToAPage/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForumDocumentation/CookBook/AddAQueueServiceToAPage/i does not exist. Click to create it.">i</a>);
        }
      };

      timer = setInterval( queue.pull , 1000 );
    };

    functioon processMessage(message) {
    //do something with the message
    }

## An error has occurred.

{{OpenForum.errorMessage}}

See technical details

×

## Error details.

{{OpenForum.error}}

×

## {{OpenForum.alert.title}}

{{OpenForum.alert.message}}

×