Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 14684 invoked from network); 7 Jul 2010 19:25:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Jul 2010 19:25:04 -0000 Received: (qmail 99208 invoked by uid 500); 7 Jul 2010 19:25:04 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 99126 invoked by uid 500); 7 Jul 2010 19:25:03 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 99114 invoked by uid 99); 7 Jul 2010 19:25:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jul 2010 19:25:03 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [64.251.173.164] (HELO filter3.e-filtering.net) (64.251.173.164) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jul 2010 19:24:54 +0000 X-ASG-Debug-ID: 1278530657-3c02013f0000-Ri9J0o X-Barracuda-URL: http://64.251.173.164:8000/cgi-bin/mark.cgi Received: from [192.168.1.123] (98.159.184.101.dsl.venturecomm.net [98.159.184.101]) by filter3.e-filtering.net (Spam Firewall) with ESMTP id 96541368FF84 for ; Wed, 7 Jul 2010 13:24:17 -0600 (MDT) Received: from [192.168.1.123] (98.159.184.101.dsl.venturecomm.net [98.159.184.101]) by filter3.e-filtering.net with ESMTP id IQGPcSl75KrpY9OV for ; Wed, 07 Jul 2010 13:24:17 -0600 (MDT) Message-Id: <8075A00D-AFAD-4ED9-8D1C-6A05FA6C6651@meteostar.com> From: Alex Dean To: users@activemq.apache.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) X-ASG-Orig-Subj: help with ajax Subject: help with ajax Date: Wed, 7 Jul 2010 14:24:16 -0500 X-Mailer: Apple Mail (2.936) X-Barracuda-Connect: 98.159.184.101.dsl.venturecomm.net[98.159.184.101] X-Barracuda-Start-Time: 1278530657 X-Barracuda-Virus-Scanned: by E-Filtering Spam Firewall at e-filtering.net X-Barracuda-Spam-Score: 1.50 X-Barracuda-Spam-Status: No, SCORE=1.50 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=5.0 KILL_LEVEL=6.0 tests=WEIRD_PORT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.34653 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.50 WEIRD_PORT URI: Uses non-standard port number for HTTP X-Virus-Checked: Checked by ClamAV on apache.org Hello. I'm trying out the ActiveMQ ajax messaging described at http://activemq.apache.org/ajax.html . I am able to send messages to a topic using this code: When I run that snippet, I see (in the ActiveMQ admin application) that the topic gets created and that the 'Messages Enqueued' value goes to '1'. Next, I try to subscribe to the topic using the following Javascript (in a separate web page): When I run this, I see the 'Number of Consumers' go to '1' in the admin application. Using Firebug, I see amq.js performing a POST like 'destination=topic://MY.DEMO&message=test_subscriber&type=listen'. This seems to be as expected based on the tutorial. I then see amq.js perform a series of GET requests. The first is 'https://localhost:7998/amq?timeout=10&_=' , and successive GETs are 'https://localhost:7998/amq'. All of these GETs are returned with empty responses, like ''. The first one appears to return immediately, and the subsequent GETs time out after maybe 20-30 seconds. When I next publish a new message to the topic, the 'Number of Consumers' immediately goes to '0'. The consumer's current GET request doesn't appear to return at this time, rather it seems to time out just like the others. (I expected that ActiveMQ would return the message to the consumer as soon as it was available, and then close the connection.) I noticed the following snippet from the logs from around the time a message was published (while the consumer was active): jvm 1 | DEBUG | Sent to topic:// MY.DEMO jvm 1 | DEBUG | RESPONSE /demo/amq 200 jvm 1 | DEBUG | message for ActiveMQMessageConsumer { value=ID:rutabaga.local-63558-1278527484508-2:1:1:1, started=true }continuation=null jvm 1 | DEBUG | localhost removing consumer: ID:rutabaga.local-63558-1278527484508-2:1:1:1 for destination: topic:// MY.DEMO I have 2 questions at the moment: 1. Why does my consumer not receive the messages published to the topic? 2. Why is my consumer unsubscribed when a message is sent? Any help is appreciated. regards, alex My environment: Mac OSX 10.5.6 ActiveMQ 5.3.2 java version "1.5.0_22" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22- b03-333-9M3125) Java HotSpot(TM) Client VM (build 1.5.0_22-147, mixed mode, sharing) Apache is listening on port 7998. Apache is proxying requests to ActiveMQ using the directive 'ProxyPass /amq http://localhost:8161/demo/amq'