activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From habumaster <phil.din...@ericsson.com>
Subject Re: Question about ajax.html examples on website
Date Wed, 19 Jan 2011 04:40:50 GMT

Thanks Alex!

My config mirrors yours (Passenger,etc)

Still having issues with the demo js clients
It seems like I am asking for something from the queue that does not exist 

2 Problems

1. EOFException on injection of a message to a queue
2. Web Polling via JQuery/Prototype gets empty AjaxResponses

Setup: 
ActiveMQ 5.4.2 running

Ruby script to push item to a queue. 

#!/usr/bin/ruby
require 'rubygems'
require 'stomp'
conn=Stomp::Client.new("", "", "localhost", "61613", false)
conn.publish("/topic//topic/ActiveMQFeed", "Hello from Ruby!",
{'amq-msg_type'=>'text'})

I can see the queue created and items enqueued   

<topic name="/topic/ActiveMQFeed">
<stats size="0" consumerCount="0" enqueueCount="4" dequeueCount="0"/>
</topic>

Problem 1: 
I do see a EOFException on every insert of an item

2011-01-18 17:01:33,647 | DEBUG | Setting up new connection id:
ID:localhost.localdomain-36434-1295385138968-4:10, address: /127.0.0.1:45487
| org.apache.activemq.broker.TransportConnection | ActiveMQ Transport:
tcp:///127.0.0.1:45487
2011-01-18 17:01:33,654 | DEBUG | Transport failed: java.io.EOFException |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: tcp:///127.0.0.1:45487
java.io.EOFException
        at java.io.DataInputStream.readByte(DataInputStream.java:267)
        at
org.apache.activemq.transport.stomp.StompWireFormat.readLine(StompWireFormat.java:146)
        at
org.apache.activemq.transport.stomp.StompWireFormat.parseAction(StompWireFormat.java:162)
        at
org.apache.activemq.transport.stomp.StompWireFormat.unmarshal(StompWireFormat.java:92)
        at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:227)
        at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:219)
        at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:202)
        at java.lang.Thread.run(Thread.java:636)




Made a myTest.html in the demo dir:

<html>
<head>
<title>Chat</title>
//<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/amq_prototype_adapter.js"></script>
<script type="text/javascript" src="js/amq.js"></script>
<script type="text/javascript"> 
var amq=org.activemq.Amq;
var MyHandler = {
	rcvMessage: function(message)
   {
    alert("received "+message);
    }
};
//amq.init({ uri: 'amq', logging: true, timeout: 45 

amq.init({ uri: 'amq', 
           sessionInitializedCallBack: function() {
		amq.addListener("testHandler", "/topic/ActiveMQFeed",
MyHandler.rcvMessage);
           }         
});
</script>
</head>
<body>
</body>
</html>


Problem 2:

I can see the web page polling for AjaxResponses (using both JQuery and
Prototytpe and getting empty responses
  
Firebug output below:

http://localhost:8161/demo/amq
timeout=25000&d=1295394122219&r=0.7264120959960031

http://localhost:8161/demo/js/prototype.js(line 1421)

Response Headersview source
Content-Type	text/xml;charset=ISO-8859-1
Cache-Control	no-cache
Content-Length	33
Server	Jetty(7.1.6.v20100715)
Request Headersview source
Host	localhost:8161
User-Agent	Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7)
Gecko/20100726 CentOS/3.6-3.el5.centos Firefox/3.6.7
Accept	text/javascript, text/html, application/xml, text/xml, */*
Accept-Language	en-us,en;q=0.5
Accept-Encoding	gzip,deflate
Accept-Charset	ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive	115
Connection	keep-alive
X-Requested-With	XMLHttpRequest
X-Prototype-Version	1.6.1
Referer	http://localhost:8161/demo/myTest.html
Cookie	JSESSIONID=rl792t9bbe6l89o4uxli0m62

ParamsHeadersPostPutResponseCacheHTML
d	1295394122219
r	0.7264120959960031
timeout	25000
Response Headersview source
Content-Type	text/xml;charset=ISO-8859-1
Cache-Control	no-cache
Content-Length	33
Server	Jetty(7.1.6.v20100715)
Request Headersview source
Host	localhost:8161
User-Agent	Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7)
Gecko/20100726 CentOS/3.6-3.el5.centos Firefox/3.6.7
Accept	text/javascript, text/html, application/xml, text/xml, */*
Accept-Language	en-us,en;q=0.5
Accept-Encoding	gzip,deflate
Accept-Charset	ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive	115
Connection	keep-alive
X-Requested-With	XMLHttpRequest
X-Prototype-Version	1.6.1
Referer	http://localhost:8161/demo/myTest.html
Cookie	JSESSIONID=rl792t9bbe6l89o4uxli0m62


Response
<ajax-response>
</ajax-response>

Turned on Stomp debugging:

2011-01-18 17:01:44,722 | DEBUG | GET
client=org.apache.activemq.web.AjaxWebClient@1f40b69
session=i1mx9l5bkiyxjqkstf49ghie clientId=null uri=/demo/amq
query=timeout=25000&d=1295391704675&r=0.2505788100026941 |
org.apache.activemq.web.MessageListenerServlet | qtp949587-35
2011-01-18 17:01:44,722 | DEBUG | doMessage timeout=25000 |
org.apache.activemq.web.MessageListenerServlet | qtp949587-35


2011-01-18 17:18:21,013 | INFO  | Started
SelectChannelConnector@0.0.0.0:8161 | org.eclipse.jetty.util.log | main
2011-01-18 17:18:41,568 | INFO  | Transport failed: java.io.EOFException |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: tcp:///127.0.0.1:56318










-- 
View this message in context: http://activemq.2283324.n4.nabble.com/Question-about-ajax-html-examples-on-website-tp3216811p3224550.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message