From users-return-25667-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Mon Oct 11 14:34:01 2010 Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 5340 invoked from network); 11 Oct 2010 14:34:01 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Oct 2010 14:34:01 -0000 Received: (qmail 99237 invoked by uid 500); 11 Oct 2010 14:34:00 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 98851 invoked by uid 500); 11 Oct 2010 14:33:58 -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 98843 invoked by uid 99); 11 Oct 2010 14:33:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Oct 2010 14:33:57 +0000 X-ASF-Spam-Status: No, hits=1.0 required=10.0 tests=SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of alex@crackpot.org does not designate 64.251.173.164 as permitted sender) Received: from [64.251.173.164] (HELO filter3.e-filtering.net) (64.251.173.164) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Oct 2010 14:33:52 +0000 X-ASG-Debug-ID: 1286807609-77f900ff0000-Ri9J0o X-Barracuda-URL: http://64.251.173.164:8000/cgi-bin/mark.cgi Received: from [192.168.1.123] (98.159.181.127.dsl.venturecomm.net [98.159.181.127]) by filter3.e-filtering.net (Spam Firewall) with ESMTP id E81073FA292E for ; Mon, 11 Oct 2010 08:33:29 -0600 (MDT) Received: from [192.168.1.123] (98.159.181.127.dsl.venturecomm.net [98.159.181.127]) by filter3.e-filtering.net with ESMTP id VKCHsl9sItXp4QK4 for ; Mon, 11 Oct 2010 08:33:29 -0600 (MDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1081) X-ASG-Orig-Subj: Re: multiple ajax clients in the same browser? Subject: Re: multiple ajax clients in the same browser? From: Alex Dean In-Reply-To: <69185FA7-3AF3-44C7-8340-A91550E40B75@crackpot.org> Date: Mon, 11 Oct 2010 09:33:28 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <24BD88E6-140E-4D38-9DA3-1322BDFF3C72@crackpot.org> References: <15163C87-6385-45D1-BCCC-5B172D5A377E@crackpot.org> <0588DF44-97C5-4106-88AE-BC3F4CE50E1A@crackpot.org> <8D3A0F37-C6A0-4973-AD9F-4B4105066E07@crackpot.org> <7C72CA42-BE1B-423D-BA70-80AA155FB095@crackpot.org> <69185FA7-3AF3-44C7-8340-A91550E40B75@crackpot.org> To: users@activemq.apache.org X-Mailer: Apple Mail (2.1081) X-Barracuda-Connect: 98.159.181.127.dsl.venturecomm.net[98.159.181.127] X-Barracuda-Start-Time: 1286807609 X-Barracuda-Virus-Scanned: by E-Filtering Spam Firewall at e-filtering.net X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=5.0 KILL_LEVEL=6.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.43378 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Has anyone had a chance to review this patch yet? = https://issues.apache.org/activemq/browse/AMQ-2948 thanks, alex On Oct 1, 2010, at 8:38 AM, Alex Dean wrote: > Great, thanks Dejan. >=20 > One issue I have noticed with this change: Sometimes when I close a = browser window which is using amq.js, I start seeing messages like this = in my debugging log... >=20 > DEBUG | message for ActiveMQMessageConsumer { = value=3DID:rutabaga.local-65016-1285865065176-4:3:1:1, started=3Dtrue = }continuation=3Dorg.eclipse.jetty.server.AsyncContinuation@267f59c7@IDLE,i= nitial > DEBUG | Async client internal exception occurred with no exception = listener registered: java.lang.IllegalStateException: IDLE,initial > java.lang.IllegalStateException: IDLE,initial > at = org.eclipse.jetty.server.AsyncContinuation.dispatch(AsyncContinuation.java= :364) > at = org.eclipse.jetty.server.AsyncContinuation.resume(AsyncContinuation.java:7= 56) > at = org.apache.activemq.web.AjaxListener.onMessageAvailable(AjaxListener.java:= 50) > at = org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsum= er.java:1250) > at = org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecut= or.java:134) > at = org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecuto= r.java:205) > at = org.apache.activemq.thread.DedicatedTaskRunner.runTask(DedicatedTaskRunner= .java:98) > at = org.apache.activemq.thread.DedicatedTaskRunner$1.run(DedicatedTaskRunner.j= ava:36) >=20 > This is repeated periodically, until the cleanup Timer/TimerTask runs, = then these messages cease. It seems like maybe I need to be cleaning up = the Continuation used by AjaxListener somehow? The fact that this only = happens for an abandoned web client, and is resolved when the cleanup = thread runs, made me think it's not critical, but I'd still like to = figure out why it's happening. >=20 > alex >=20 > On Oct 1, 2010, at 3:36 AM, Dejan Bosanac wrote: >=20 >> Thanks Alex, >>=20 >> I'll see to take a look at (and commit) it in the next couple of = days. >>=20 >>=20 >> Cheers >> -- >> Dejan Bosanac - http://twitter.com/dejanb >>=20 >> Open Source Integration - http://fusesource.com/ >> ActiveMQ in Action - http://www.manning.com/snyder/ >> Blog - http://www.nighttale.net >>=20 >>=20 >>=20 >> On Thu, Sep 30, 2010 at 11:14 PM, Alex Dean = wrote: >>> I attached a new (and hopefully much-improved) patch to this ticket. = Reviews appreciated. >>>=20 >>> alex >>>=20 >>> On Sep 28, 2010, at 12:29 PM, Alex Dean wrote: >>>=20 >>>> I just submitted a patch to allow multiple windows in the same = browser to send/receive messages via ajax. >>>>=20 >>>> https://issues.apache.org/activemq/browse/AMQ-2948 >>>>=20 >>>> alex >>>>=20 >>>> On Sep 13, 2010, at 10:48 AM, Dejan Bosanac wrote: >>>>=20 >>>>> Hi Alex, >>>>>=20 >>>>> with REST API (which shares some common code with Ajax stuff), you = can >>>>> send clientId parameter to create/use client with the specified id >>>>> (and not be tied to the session). IMHO it should work the same = with >>>>> Ajax API, so you can try with that for starters. If it doesn't = work, >>>>> take a look at MessageListenerServlet >>>>>=20 >>>>> = http://fisheye6.atlassian.com/browse/activemq/trunk/activemq-web/src/main/= java/org/apache/activemq/web/MessageListenerServlet.java?r=3DHEAD >>>>>=20 >>>>> as that is where's the most of the server side logic is = implemented. >>>>>=20 >>>>> If you need to look at the REST Servlet for the reference, take a = look at >>>>>=20 >>>>> = http://fisheye6.atlassian.com/browse/activemq/trunk/activemq-web/src/main/= java/org/apache/activemq/web/MessageServlet.java?r=3DHEAD >>>>>=20 >>>>> Cheers >>>>> -- >>>>> Dejan Bosanac - http://twitter.com/dejanb >>>>>=20 >>>>> Open Source Integration - http://fusesource.com/ >>>>> ActiveMQ in Action - http://www.manning.com/snyder/ >>>>> Blog - http://www.nighttale.net >>>>>=20 >>>>>=20 >>>>>=20 >>>>> On Mon, Sep 13, 2010 at 3:46 PM, Alex Dean = wrote: >>>>>> I'd be interested in attempting a fix for this problem. Please = send along >>>>>> any information you think would help me get started. >>>>>>=20 >>>>>> thanks, >>>>>> alex >>>>>>=20 >>>>>> On Sep 13, 2010, at 3:25 AM, Dejan Bosanac wrote: >>>>>>=20 >>>>>>> Hi Alex, >>>>>>>=20 >>>>>>> unfortunately this is not supported at the moment as listeners = are >>>>>>> tied to the session. The right approach would be to use some = clientId >>>>>>> defined in your application, like we have for REST and pass it = to the >>>>>>> servlet. If you're interested in taking a stab at implementing = this, I >>>>>>> can point you to the code that should be improved. >>>>>>>=20 >>>>>>> Cheers >>>>>>> -- >>>>>>> Dejan Bosanac - http://twitter.com/dejanb >>>>>>>=20 >>>>>>> Open Source Integration - http://fusesource.com/ >>>>>>> ActiveMQ in Action - http://www.manning.com/snyder/ >>>>>>> Blog - http://www.nighttale.net >>>>>>>=20 >>>>>>>=20 >>>>>>>=20 >>>>>>> On Fri, Sep 10, 2010 at 6:46 PM, Alex Dean = wrote: >>>>>>>>=20 >>>>>>>> I have been testing a web page displaying activemq data via the = AJAX >>>>>>>> interface with AMQ 5.4. It works great when I have a single = window open. >>>>>>>> If I open the same page in a new browser window or tab, the new >>>>>>>> window/tab >>>>>>>> updates correctly but the previously-open one stops updating. >>>>>>>>=20 >>>>>>>> Firebug/Firefox in the previously-opened window starts = reporting errors >>>>>>>> like >>>>>>>> "No handler found to match message with id =3D = display43066495". >>>>>>>> 'display43066495' is the id used by the newly-opened window. I = had >>>>>>>> tried >>>>>>>> ensuring that both windows opened with unique ids, but this = hasn't solved >>>>>>>> the problem. >>>>>>>>=20 >>>>>>>> I imagine this is due to the fact that both windows share the = same >>>>>>>> session >>>>>>>> id on the broker. Is there a way to work around this problem, = so I can >>>>>>>> have >>>>>>>> multiple windows open to the same amq/ajax-connected page? >>>>>>>>=20 >>>>>>>> thanks, >>>>>>>> alex >>>>>>>>=20 >>>>>>>=20 >>>>>>=20 >>>>>>=20 >>>>>=20 >>>>=20 >>>>=20 >>>=20 >>>=20 >>=20 >=20 >=20