activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Dean <a...@crackpot.org>
Subject Re: multiple ajax clients in the same browser?
Date Fri, 01 Oct 2010 13:38:21 GMT
Great, thanks Dejan.

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...

DEBUG | message for ActiveMQMessageConsumer { value=ID:rutabaga.local-65016-1285865065176-4:3:1:1,
started=true }continuation=org.eclipse.jetty.server.AsyncContinuation@267f59c7@IDLE,initial
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:756)
	at org.apache.activemq.web.AjaxListener.onMessageAvailable(AjaxListener.java:50)
	at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1250)
	at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:134)
	at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:205)
	at org.apache.activemq.thread.DedicatedTaskRunner.runTask(DedicatedTaskRunner.java:98)
	at org.apache.activemq.thread.DedicatedTaskRunner$1.run(DedicatedTaskRunner.java:36)

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.

alex

On Oct 1, 2010, at 3:36 AM, Dejan Bosanac wrote:

> Thanks Alex,
> 
> I'll see to take a look at (and commit) it in the next couple of days.
> 
> 
> Cheers
> --
> Dejan Bosanac - http://twitter.com/dejanb
> 
> Open Source Integration - http://fusesource.com/
> ActiveMQ in Action - http://www.manning.com/snyder/
> Blog - http://www.nighttale.net
> 
> 
> 
> On Thu, Sep 30, 2010 at 11:14 PM, Alex Dean <alex@crackpot.org> wrote:
>> I attached a new (and hopefully much-improved) patch to this ticket.  Reviews appreciated.
>> 
>> alex
>> 
>> On Sep 28, 2010, at 12:29 PM, Alex Dean wrote:
>> 
>>> I just submitted a patch to allow multiple windows in the same browser to send/receive
messages via ajax.
>>> 
>>> https://issues.apache.org/activemq/browse/AMQ-2948
>>> 
>>> alex
>>> 
>>> On Sep 13, 2010, at 10:48 AM, Dejan Bosanac wrote:
>>> 
>>>> Hi Alex,
>>>> 
>>>> 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
>>>> 
>>>> http://fisheye6.atlassian.com/browse/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java?r=HEAD
>>>> 
>>>> as that is where's the most of the server side logic is implemented.
>>>> 
>>>> If you need to look at the REST Servlet for the reference, take a look at
>>>> 
>>>> http://fisheye6.atlassian.com/browse/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java?r=HEAD
>>>> 
>>>> Cheers
>>>> --
>>>> Dejan Bosanac - http://twitter.com/dejanb
>>>> 
>>>> Open Source Integration - http://fusesource.com/
>>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>>> Blog - http://www.nighttale.net
>>>> 
>>>> 
>>>> 
>>>> On Mon, Sep 13, 2010 at 3:46 PM, Alex Dean <alex@crackpot.org> wrote:
>>>>> I'd be interested in attempting a fix for this problem.  Please send
along
>>>>> any information you think would help me get started.
>>>>> 
>>>>> thanks,
>>>>> alex
>>>>> 
>>>>> On Sep 13, 2010, at 3:25 AM, Dejan Bosanac wrote:
>>>>> 
>>>>>> Hi Alex,
>>>>>> 
>>>>>> 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.
>>>>>> 
>>>>>> Cheers
>>>>>> --
>>>>>> Dejan Bosanac - http://twitter.com/dejanb
>>>>>> 
>>>>>> Open Source Integration - http://fusesource.com/
>>>>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>>>>> Blog - http://www.nighttale.net
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On Fri, Sep 10, 2010 at 6:46 PM, Alex Dean <alex@crackpot.org>
wrote:
>>>>>>> 
>>>>>>> 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.
>>>>>>> 
>>>>>>> Firebug/Firefox in the previously-opened window starts reporting
errors
>>>>>>> like
>>>>>>> "No handler found to match message with id = 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.
>>>>>>> 
>>>>>>> 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?
>>>>>>> 
>>>>>>> thanks,
>>>>>>> alex
>>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 


Mime
View raw message