Re: Message queues
Subject: Re: Message queues
Newsgroups: gmane.comp.web.services.rest
Date: 2007-06-13 14:38:28 GMT
On Jun 13, 2007, at 7:23 AM, Paul Winkler wrote:
> On Tue, Jun 12, 2007 at 09:52:34PM -0700, Mike Dierken wrote:
> > Why would RPC take fewer round trips?
>
> I meant something like:
>
> service = SomeFlavorOfRPCServer('http://example.org/endpoint')
> message = service.popMessage()
>
> But now I realize this lacks the "message reconciliation" feature from
> Bill's proposal - the server doesn't know if the client successfully
> handled the message. So we need to add something like:
>
> service.acknowlegeReceipt(message.id)
>
> So now we've got two hits. Bill's proposal has three; so far I still
> haven't seen a RESTful way to spell "retrieve a resource from a
> collection, but I don't care what the resource's actual URL is, I just
> want the oldest one in the collection". (Or newest if it's a stack
> rather than a queue.)
How about using different media types?
To add an item:
POST /queue
Content-Type: application/xml (or whatever a queue item is)
-->
201 Created
Location: http://server.com/queue/itemXYZ
To request to pop an item:
POST /queue
Content-Type: application/w-www-form-urlencoded
AckTTL=60 (where AckTTL is the time to acknowledge the queue item or
it becomes available again)
-->
200 Ok
http://server.com/queue/itemABC
To delete a popped item:
DELETE /queue/itemABC
...
- Steve
--------------
Steve G. Bjorg
http://www.mindtouch.com
http://www.opengarden.org
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___
RSS Feed