Erlang/OTP Forums

Author Message

<  RabbitMQ mailing list  ~  PHP AMQP client?

Guest
Posted: Fri Sep 28, 2007 7:11 am Reply with quote
Guest
Is anyone aware of a PHP AMQP client that is usable with RabbitMQ?

Tom

_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post recived from mailinglist
alexis
Posted: Fri Sep 28, 2007 2:19 pm Reply with quote
User Joined: 06 Sep 2007 Posts: 80 Location: London
Tom

Good question. The short answer is no. I do not think Qpid has one
either, or you could use that with RabbitMQ.

At the risk of sounding importunate ... how would you like to write one?

alexis



On 9/28/07, Tom Samplonius <tom@samplonius.org> wrote:
>
> Is anyone aware of a PHP AMQP client that is usable with RabbitMQ?
>
> Tom
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss@lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>


--
Alexis Richardson
+44 20 7617 7339 (UK)
+44 77 9865 2911 (cell)
+1 650 206 2517 (US)

_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post recived from mailinglist
View user's profile Send private message Yahoo Messenger
Guest
Posted: Sat Sep 29, 2007 1:12 am Reply with quote
Guest
----- "Alexis Richardson" <alexis.richardson@cohesiveft.com> wrote:
> On 9/28/07, Tom Samplonius <tom@samplonius.org> wrote:
> > > Does that make any sense?
> >
> > While linking a C library to PHP would do the trick, introducing a
> new module API into PHP is definitely non-trivial.
> >
> > I was hoping that there might be a native PHP library. Isn't the
> Ruby library pure Ruby? AMQP is a binary protocol, so a native PHP is
> a bit hard, but appears doable.
>
> OK. You are right about the Ruby client. I'm afraid there is no
> native PHP client. What are your thoughts on the pros and cons of
> doing one? How useful would it be to you?

Well, what is challenging about the PHP environment, is any long running tasks. That is anything that can't be done during the http request/response cycle. You will want to have a background worker handle any processing that takes 10+ seconds. So the web handler can just put a message in the queue, and a background worker can process it.

Also, doing critical steps in a web response code isn't exactly great either, because the Stop button issues. In some cases, a stop, will cause the web server to stop the PHP interpreter, possible leaving various things in a unknown state. Particularly if your PHP script is talking to an external web service. It would be much better to have any critical processing done by a background worker, which has a more stable execution environment.

An another issue, is serialization. I have a remote control hardware device connected to a serial port. Only one application can be talking to it at once. A message queue provides an ideal serialization mechanism.

> alexis
>
>
>
> --
> Alexis Richardson
> +44 20 7617 7339 (UK)
> +44 77 9865 2911 (cell)
> +1 650 206 2517 (US)


Tom

_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post recived from mailinglist
alexis
Posted: Sun Sep 30, 2007 2:47 pm Reply with quote
User Joined: 06 Sep 2007 Posts: 80 Location: London
Tom

Thanks for describing the use cases. Knowing nothing about PHP, I
would never have realised the server workflow could benefit from
messaging in this way.

I've been scratching my head trying to think of a way to help. One
thought was to combine one of the C clients (say, OpenAMQ, which is
BSD licensed iirc), with the WSF/PHP plug-in from WSO2, which loads
processors for, eg SOAP and WS-RM, to a PHP web server. There is
enough family resemblance between WS and REST style invocations, and
AMQP, that the source code might help you. You can get it from here:
http://dist.wso2.org/products/wsf/php/1.0.0/

Feel free to flame me if this is a completely bogus suggestion.

Thoughts?

alexis



On 9/29/07, Tom Samplonius <tom@samplonius.org> wrote:
>
> Well, what is challenging about the PHP environment, is any long running tasks. That is anything that can't be done during the http request/response cycle. You will want to have a background worker handle any processing that takes 10+ seconds. So the web handler can just put a message in the queue, and a background worker can process it.
>
> Also, doing critical steps in a web response code isn't exactly great either, because the Stop button issues. In some cases, a stop, will cause the web server to stop the PHP interpreter, possible leaving various things in a unknown state. Particularly if your PHP script is talking to an external web service. It would be much better to have any critical processing done by a background worker, which has a more stable execution environment.
>
> An another issue, is serialization. I have a remote control hardware device connected to a serial port. Only one application can be talking to it at once. A message queue provides an ideal serialization mechanism.
>
> > alexis
> >
> >
> >
> > --
> > Alexis Richardson
> > +44 20 7617 7339 (UK)
> > +44 77 9865 2911 (cell)
> > +1 650 206 2517 (US)
>
>
> Tom
>


--
Alexis Richardson
+44 20 7617 7339 (UK)
+44 77 9865 2911 (cell)
+1 650 206 2517 (US)

_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post recived from mailinglist
View user's profile Send private message Yahoo Messenger
tonyg
Posted: Tue Oct 02, 2007 9:12 am Reply with quote
User Joined: 07 Nov 2006 Posts: 199
Hi Tom,

Tom Samplonius wrote:
> Well, what is challenging about the PHP environment, is any long
> running tasks. That is anything that can't be done during the http
> request/response cycle.

This lines up nicely with your other thread, about RESTful access to
AMQP. Creating a full AMQP connection for every PHP script invocation
seems very heavy - it's not only a full TCP connection, but it's several
roundtrips between the client and broker. Perhaps a lighter RESTful
HTTP-to-AMQP portal would work better: PHP scripts would both submit and
retrieve messages via AMQP-over-HTTP...

I'll have to dig out my sketchy notes on what a good AMQP-over-HTTP
would look like.

Regards,
Tony


_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post recived from mailinglist
View user's profile Send private message MSN Messenger

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum