[rabbitmq-discuss] help: simple web application integration and testing
go canal
gocanal at yahoo.com
Sat May 22 04:09:32 BST 2010
Hello,
I am new to RabbitMQ, wanted to setup a quick testing web page. This is what I did so far, but I am not able to get anything:
* Jetty 7.0.2, Spring 3.0.2, running inside Eclipse 3.5.1
* Using RabbitMQ 1.7.2, amqp-js. RabbitMQ running on localhost.
Here is my web page (using the part of the sample application in amqp-js):
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="<%=request.getContextPath()%>/scripts/swfobject.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/scripts/mq.js" type="text/javascript"></script>
</head>
<button onclick="sendMsg();">Send Message</button>
<script type="text/javascript">
function sendMsg () {
MQ.exchange("stocks").publish({ value: -45.00 }, "stocks.nyse.amd");
}
MQ.configure({
//enable logging to the console
logger: console,
host: "localhost"
});
MQ.on("load", function() {
console.log("Test");
});
MQ.on("connect", function() {
alert("Connected");
});
MQ.on("disconnect", function() {
alert("Disconnected");
});
MQ.queue("auto").callback(function(m) {
alert("No Binding Matches");
});
MQ.queue("auto").bind("stocks", "stocks.#").callback(function(m) {
alert("All Indexs " + m.data.value);
});
</script>
</body>
</html>
When clicking the button, I do not see anything.
any help is very much appreciated!
rgds,
canal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100521/4587b055/attachment.htm
More information about the rabbitmq-discuss
mailing list