Re: support for Stomp protocol

5 views
Skip to first unread message

Jack Zai

unread,
Sep 10, 2007, 8:25:26 PM9/10/07
to phpsam
Hello!

Sorry, this took me two month to get to. Heads down doing PHP SCA.
I've uploaded a zip file containing the whole sam folder on my
machine, along with a eclipse patch file made against the HEAD
branch.

It's mainly about a new support for Stomp protocol[1], which can be
used for connecting to Apache ActiveMQ. Stomp supports the publish/
subscribe styles of messaging, but you achieve a point-to-point
messaging by sending a sequence of stomp messages. Although Stomp
supports the synchronous message delivery, it does not return with the
MessageID. So this may conflict with the SAM API where the send method
should return the message identity of the message on the queue.

The changes are summarised as following:

1. two lines added to php_sam.c for registering constants
SAM_CONSTANT_PRIORITY and SAM_CONSTANT_TIMETOLIVE
2. php_sam.php - slightly changed the if statement in the create
method, for selecting stomp protocol.
3. added file sam_factory_stomp.php
4.created new folder Stomp
5.added file Stomp/Stomp.php
The Stomp PHP client from codehaus[2], I don't know if we have
problem of redistribution of this file
6.added file Stomp/sam_stomp.php
The main class, adapts the stomp client into the SAM API
7. plus three testcases

I would like someone check in the changes for me, as I don't have a
pecl account. Any questions or suggestions of furtuer improvement are
more than welcome!

Thanks

Jack

Reference:
[1]Stomp Protocol Specification http://stomp.codehaus.org/Protocol
[2] Stomp client for PHP http://stomp.codehaus.org/PHP

P.S. I don't know why i cannot reple to my old discussion, it prompted
"Replies to this message are not allowed"

dsr

unread,
Sep 11, 2007, 11:09:36 AM9/11/07
to phpsam
Great stuff Jack. I'll look at incorporating your STOMP support into
the package.

Cheers
Dave

Reply all
Reply to author
Forward
0 new messages