Service Broker Listener
Entourage MQ supports communication with Entourage Service Brokers implemented in a number of server-side technologies, such as Java EE, Google App Engine, and PHP.
Sending Remote Messages
Messages are dispatched to the Appcelerator Service Broker when they are prefixed with an r: or remote:. Typically, request messages end with the string .request as in the example below, but they need not conform to this convention.
<script> $MQ("r:get.foos.request", { foo:"bar" }); </script>
All the data in the payload object is serialized to JSON and sent to the server, and will be received by the service broker on the back end. When the message is received, the service broker routes the request to the proper handler method, which executes business logic on the server. For more on programming server-side services with Entourage Service Brokers, check out that section of our documentation.
Handling responses
When a response is received from the server, MQ will publish a response message with a name and data payload specified by the server. The name of the response message is configured in the service method annotation in your server side code.
$MQL("r:get.foos.response", function(message) { //execute some logic, usually using message.payload });