You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ipsi <nz...@gmail.com> on 2008/05/23 01:00:54 UTC

Creating temporary connections from Javascript?

I'm trying to do something that I would have thought would be quite simple:
Use JMS to provide communication back and forth between a AJAX-enabled
webpage and a server.

However, that's being harder than I would have liked because I can't (as far
as I can tell) create a temporary Queue via AJAX, and any temporary Queues
that I do create can't be consumed on the AJAX side. I've got no idea how
many clients are going to be connected at once, so I can't really create
static queues and hope for the best.

The only solution I can see at this stage is to use Topics, but that worries
me - I can't imagine the performance would be even remotely acceptable once
you hit more than 10 clients or so, each asking for information every 10
seconds.

So, are Topics the only solution? Or is there a better way (and that better
way must work with AJAX).
-- 
View this message in context: http://www.nabble.com/Creating-temporary-connections-from-Javascript--tp17415277s2354p17415277.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Creating temporary connections from Javascript?

Posted by ipsi <nz...@gmail.com>.
Ok, here's my problem: AJAX can create and receive messages from dynamic
Queues, but as far as I can tell, the Java code can't receive messages from
it. It can send them, however! What's up with this? 

Am I not connecting to the AMQ Connection Factory? As far as I can tell, I
am though. I'm not getting any form of error. It just doesn't pick them up.

Could it be because it's an MDB, and an MDB can never receive messages other
than from the Queue it's assigned to?

Having said that, I've just realised this isn't a problem in any way, shape
or form for me - all I wanted was for it to be able to send to the client,
as it should never have to receive anything on these Queues.

All hail the mighty internet!

- Andrew
-- 
View this message in context: http://www.nabble.com/Creating-temporary-connections-from-Javascript--tp17415277s2354p17416851.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Creating temporary connections from Javascript?

Posted by ipsi <nz...@gmail.com>.
Ok, I guess I should have read the AMQ documentation that says it can create
Queues on the fly. I didn't think about that because the J2EE docs explicity
say that that doesn't work.

Just to double check though, creating a regular queue with
session.createQueue will work just fine, right? I'm about to test it, and if
anyone has any better suggestions, I'd be interested in hearing them.
-- 
View this message in context: http://www.nabble.com/Creating-temporary-connections-from-Javascript--tp17415277s2354p17415533.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.