Home > ext.mq

ext.mq

Ext.mq is a project mainly written in JavaScript, it's free.

Message Queue implementation for Ext.Core / Ext.JS with webservice gateway for easy remoting.

h2. Synopsis

Ext.MQ is a simple message queue implementation with a webservice gateway for easy remoting. It simplyfies loose coupling between components and webservice communication a lot. I really didnt't like the Ext.Direct mechanism, so I developed this small class to connect a Ext application to a Zend Framework or Symfony backend.

h2. Setup

Just include ext.mq.js in Your html file and setup the webservice base url if it is different than /:



h2. Publishing messages


h2. Subscribing messages


h2. Webservice gateway

Messages starting with webservice. are automagically converted into AJAX calls and the responses will be converted to messages, too.


This message will translate into an AJAX call to /ressource/user/create/. In case of success the result will be JSON-decoded and the resulting object will be sent in the message webservice.ressource.user.create.success. If an error occurs the result will be sent in the message webservice.ressource.user.create.failure.

To implement an universal handler for webservice failures you can simply subscribe the whole namespace starting with webservice and ending with failure as follows:


If you need another URL scheme, just overwrite the MQ.urlgenerator method.

Previous:TDDB84-Lab5