activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joel Poloney" <jpolo...@gmail.com>
Subject Basic queue concept
Date Thu, 03 Apr 2008 05:47:40 GMT
List,

I'm new to message queues, but I generally understand the concept. I've been
playing with ActiveMQ this afternoon using the PHP Stomp client to make
requests. I noticed that in the Stomp client you don't have access to any
given queue size, whereas in the JMS API I have access to these numbers. So,
assuming I stick with the Stomp API, I can think of 2 basic ways that I
could implement a consumer:

1. I have a consumer in a while(1) { //consume } fashion. That would
basically run forever. As I understand it, this is the way most web servers
work (at the core, core level). In this model, I would have to make sure
that the consumer was always running (perhaps do 3-way redundancy and have 3
consumers doing this). My concern with this model is that if I implement
this in PHP, I'm afraid of memory issues and so on. I don't necessarily
trust a PHP script to run in a while(1) fashion forever.

2. I could somehow get the queue size and batch process these. Basically,
get the queue size (say it was 200 entries), consume 200 messages and then
the PHP script would end. Then you would have this script in a cronjob that
runs every x amount of time.

Unfortunately, I have to implement this in PHP. So, I'm not really sure
which way would be the proper way to go about doing this. If any one has any
thoughts or comments, it would be greatly appreciated.

Thanks,

-- Joel

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message