As long as you do everything within the context of HTTP you will not be able to keep a persistant connection to the broker. Comet circumvents this by having long-running connections to the web server but this has never been something that the protocol should support - realize that for every open connection you are also consuming resources related to the whole HTTP request/response cycle.
Imho, a more viable approach is to embed a Flash application acting as a bridge between the web page and the broker. I have tinkered with this before[1] and found it quite easy to work with. This does unfortunately bring in a dependency on the Flash plugin for your clients. Eventually Web sockets should replace this approach though. Camel is used to integrate applications/systems. The concept is based on routes with endpoints (in/out) and intermediary components that processes messages as they flow between the endpoints. As an example, you could have one HTTP endpoint[2] that consumes POST requests, inspects the (XML) body and depending on a property[3] of this routes it to either a message queue[4] or sends out an email[5]. I don't see any clear case with camel being beneficial for a chat (maybe routing messages between different rooms/topics?). For administrative tasks camel could be a nice replacement/supplement to cron using the timer or quartz components. The question if you can have ActiveMQ support PHP is quite broad. Java does support dynamic languages thru JSR 223 (google found [6]). If you look at it from a perspective that you have a LAMP installation then you need something like [1] to connect the PHP rendered web page to the message broker while avoiding long-running HTTP connections (comet) or polling with XMLHTTPRequest. [1] http://github.com/c0dem4gnetic/directmessaging [2] http://camel.apache.org/jetty.html [3] http://camel.apache.org/message-filter.html [4] http://camel.apache.org/activemq.html [5] http://camel.apache.org/mail.html [6] http://weblogs.java.net/blog/survivant/archive/2009/02/php_on_grizzly.html Roger Hoover wrote: > > It sounds like you want to do > COMET<http://en.wikipedia.org/wiki/Comet_(programming)>. > > On Thu, Mar 4, 2010 at 5:24 PM, CauselessEffect <mjbr...@gmail.com> wrote: > >> So again, my main question for this thread is can I have ActiveMQ support >> PHP? I need user authentication (which I have with PHP) and STOMP-driven >> PHP events. > > -- View this message in context: http://old.nabble.com/ActiveMQ-Can%27t-Execute-PHP-Code-tp27739295p27819858.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.