[rabbitmq-discuss] simple.publish over the JSON RPC interface

Nathan Gray n8gray at n8gray.org
Fri Jul 31 00:28:23 BST 2009


I'm trying to use the rabbitmq-http2 bridge to create exchanges and
send messages to them via http/jsonrpc.  Creating an exchange works
fine but sending a message doesn't.  I'm using a simple python client
and I've generated the following request object:

{"version":"1.1",
"method": "cast",
"params": [
  "basic.publish",
  [1, "amq.topic", "this.that", false, false],
  "Hello world!",
  [null, null, null, null, null, null, null, null, null, null, null,
null, null, null]],
"id": 0}

AFAICT this is essentially the same as the example given in this posting:
http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2009-April/003882.html

But this is what I get as a response (sorry for the formatting):

{"version":"1.1",
"id":0,
"error":
{ "name":"JSONRPCError",
  "code":500,
  "message":"Internal error",
  "error":"{timeout,\n    {gen_server,call,\n        [<0.432.0>,\n
    {jsonrpc,<<\"cast\">>,\n             {obj,\n
[{\"http_method\",<<\"POST\">>},\n
{\"http_query_parameters\",{obj,[]}},\n
{\"http_headers\",\n                   {obj,\n
[{\"user-agent\",<<\"python\">>},\n
{\"accept\",<<\"application/json\">>},\n
{\"content-type\",<<\"application/json\">>},\n
{\"content-length\",<<\"220\">>},\n
{\"accept-encoding\",<<\"identity\">>},\n
{\"host\",<<\"localhost:55672\">>}]}},\n
{\"remote_port\",61595},\n
{\"remote_peername\",<<\"0:0:0:0:0:0:0:1\">>},\n
{\"scheme\",<<\"http\">>}]},\n             [<<\"basic.publish\">>,\n
           [1,<<\"amq.topic\">>,<<\"this.that\">>,false,false],\n
        <<\"Hello world!\">>,\n
[null,null,null,null,null,null,null,null,null,null,null,null,\n
       null,null]]}]}}"
}}

Can anybody explain what I've done wrong?

Thanks!
-n8

PS: Please CC me with replies.

-- 
http://n8gray.org




More information about the rabbitmq-discuss mailing list