{"id":443,"date":"2004-08-26T15:20:00","date_gmt":"2004-08-26T19:20:00","guid":{"rendered":"http:\/\/www.markbaker.ca\/wp\/?p=433"},"modified":"2004-08-26T15:20:00","modified_gmt":"2004-08-26T19:20:00","slug":"sean-on-queues-and-resources","status":"publish","type":"post","link":"http:\/\/www.markbaker.ca\/blog\/2004\/08\/sean-on-queues-and-resources\/","title":{"rendered":"Sean on queues and resources"},"content":{"rendered":"<p><a href=\"http:\/\/seanmcgrath.blogspot.com\/archives\/2004_08_22_seanmcgrath_archive.html#109350032302755533\">He writes;<\/a><\/p>\n\n<blockquote>\nSimply put, business resources should be &#8220;one step back&#8221; from HTTP IMHO. When you send non-idempotent messages to a resource (e.g. POST\/PUT), you send them to its inward bound, asynch message queue. You do not directly interact with the business resource.\n<\/blockquote>\n\n<p>Interesting position on queues, but I think you&#8217;ll eventually run into problems doing\nthat &#8230; though clearly not major problems, otherwise you&#8217;d have discovered them already 8-).<\/p>\n\n<p>Whenever I want to do the queue thing, I use two resources; the &#8220;business resource&#8221;, and\n&#8220;the inbound message queue for that business resource&#8221; (though of course, as a separate\nresource, it need not be used only for the business resource).  I then subscribe the business\nresource to the queue, such that messages POSTed to the queue also are forwarded to the business\nresource.  FWIW, I&#8217;ve been using <a href=\"http:\/\/www.mod-pubsub.org\/\">mod_pubsub<\/a>\nrecently to manage the queue resource (as a topic\nmaintained by its router) in some work I&#8217;m doing on the side.<\/p>\n\n<p>The problems I see with the approach Sean describes are a result of it not acknowledging\nthat the queue is a separate resource than the business resource, as this can lead to\nambiguities.  For example, what can be expected from a GET on the URI;\na representation of the state of the business resource, or a representation of the state\nof the queue?<\/p>\n\n<p>That structure I described is probably a useful Web idiom to write up&#8230; I&#8217;ll put\nit on my todo list. 8-)<\/p>\n\n<p>P.S. I assume you wanted to say &#8220;non-safe&#8221; there, since PUT is idempotent.<\/p>","protected":false},"excerpt":{"rendered":"He writes; Simply put, business resources should be &#8220;one step back&#8221; from HTTP IMHO. When you send non-idempotent messages to a resource (e.g. POST\/PUT), you send them to its inward bound, asynch message queue. You do not directly interact with the business resource. Interesting position on queues, but I think you&#8217;ll eventually run into problems [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-443","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/comments?post=443"}],"version-history":[{"count":0,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/443\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/media?parent=443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/categories?post=443"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/tags?post=443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}