Hi Maarten

> > I'm running a cluster of webservers and I'd like to write certain events
> > (logins, logouts, etc.) to a central log. To do that, I'd like the
> > webservers to send event messages to a broker. A logging machine should
> > periodically fetch, process, aggregate and write those events to a log.

For pure logging purposes, I would personally use syslog over amq, but
you can use amq as well.

>
> > 1) Building ActiveMQ with Maven takes forever. I cancelled it after ~2 hours
> > of running unit tests and grabbed myself the binary.
> I doubt there is any good reason to roll your own for a java-application
> any way?

Yes, there is no need to build it ... just grab the newest snapshot
http://people.apache.org/repo/m2-snapshot-repository/org/apache/activemq/apache-activemq/


> > 2) ActiveMQ seems to block when there's no message in a queue. I was using
> > the Stomp PHP API (which doesn't handle this gracefully) and the REST
> > interface (which seems ignore the timeout GET param). Isn't there an easy
> > way for polling a queue?
> You could adjust the code to create a non blocking stream and use
> stream_select and such, rather than plain old fgets/fread. The
> Stomp-class is quite trivial to read and adjust (you only need to adjust
> the readFrame-method).

This is on my todo list (http://stomp.codehaus.org/PHP#PHP-TODO) and I
hope I will have it soon. Of course, any contribution is more than
welcomed.

>
> > 3) Although I can see pending messages in a queue in the web console, the
> > REST / Stomp APIs block when trying to fetch them. Any ideas here?
> I'm not sure what you mean by 'block' ?
>
> > 4) Why aren't messages automatically deleted from the queue, when I fetch
> > them (subscribe in Stomp, GET in REST)?
> The php-stomp implementation defaults to client-acknowledgement when you
> subscribe. So you have to explicitly ack(nowledge) your message's (the
> id you need is in the headers of the received frame) and/or you could
> adjust the code Stomp-class to not set the acknowledgement to client.
> You only need to remove a single line for that in subscribe().


You can easily modify this behavior with the headers, for example

$conn->subscribe("/queue/test", array("ack"=>"auto"));

I'll make this configurable on the class level and document it.

Cheers
-- 
Dejan Bosanac
www.scriptinginjava.net

Reply via email to