Women in Technology

Hear us Roar



Article:
  How to Use JMS with PHP
Subject:   Why?
Date:   2004-11-15 20:16:15
From:   Solon
This article really seems to be about two different things:
* PHP/Java integration
* MantaRay JMS


Using PHP/Java integration by instantiating a JVM within the PHP cgi interpreter seems insane. The startup cost would be enormous. Since MantaRay is pure Java, you might as well just write a Java CGI.


Instantiating a separate JVM into each Apache process (pre-fork) seems every more insane. The JVM requires maybe 20MB at minimum, so creating a 100 instances (for a 100 processes, is also very expensive. Using one of the Apache 2 threaded modes would probably work best, since a single Apache process could serve multiple requests (reducing the process count and the number of JVMs created).


Why no dicussion about other JMSes? MantaRay isn't the only open-source JMS, and probably not the best. Since there is nothing PHP specific to MantaRay, ActiveMQ would probably be a better choice. And it could be used via the same PHP/Java interface (with all the same instantiation issues).


A native PHP client driver for a JMS server is really what is required in order to make JMS on PHP popular.

Full Threads Newest First

Showing messages 1 through 2 of 2.

  • Amir Shevat photo Why?
    2004-11-15 23:38:10  Amir Shevat | O'Reilly Blogger [View]

    The article is about extending the PHP to the backend enterprise Java world, a native JMS for PHP will not serve this purpose and will not give the PHP the abilities that are needed for this task.



    I agree that the PHP/JAVA extension is costly (not to the extend you describe it but still costly). In the next release of PHPMQ I intend to implement the messaging interface over HTTP. This will eliminate the need for the PHP/JAVA extension.



    Speaking of cost ... MantaRay is unique in that it uses a server-less, purely distributed architecture. You do not need a costly centralized broker (with load balancer and backups). Remove the centralized broker and you remove this single point of congestion and failure, you get better performance and a more durable system.



    Having said that, PHPMQ is an opensource project and the PHPMQ messaging interface is well defined and decoupled from the implementation, you are more then welcome to contribute code connecting PHPMQ to any other JMS provider.


    • Why?
      2005-08-17 00:24:18  JamesStrachan [View]

      RE "MantaRay is unique in that it uses a server-less, purely distributed architecture." - this is not really true.

      ActiveMQ supports a pure peer based architecture too; its the default out of the box configuration in fact. You only need to run brokers if you wish to manage persistent files on certain machine - rather than having to worry about backing up 1000s of machines persisted messags.

      So Mantaray is hardly unique - other open source JMS providers support peer networks