[rabbitmq-discuss] Using rabbitmq-http2 (was: simple.publish over the JSON RPC interface)

Nathan Gray n8gray at n8gray.org
Mon Aug 3 20:35:55 BST 2009


Oh, I should also mention that these rpc calls do "succeed" despite
the error messages.  After the call below, the exchange I declare is
successfully created.  Calling simple.publish does send a message to
the exchange.  But the caller gets stuck waiting for a couple of
seconds and then gets this exception.  I'm not sure what to make of
this, so any help would be appreciated.  I'm trying to dig deeper
myself but I don't know erlang so it's a bit tough.

Thanks,
-n8

On Mon, Aug 3, 2009 at 12:12 PM, Nathan Gray<n8gray at n8gray.org> wrote:
> Hi Cuong,
>
> Thanks for the reply!  It turns out that I'm not only hitting this
> problem with simple.publish, but also other methods.  For example,
> when I try to declare an exchange, the same thing happens.  Am I
> supposed to be acking responses to my method calls or something?
>
> Sending:
> {"version":"1.1", "method": "call", "params": ["exchange.declare", [0,
> "gx.quincy.foo.g1", "fanout", false, true, false, false, true, []]],
> "id": 0}
> -----------------------
> Response:
> 200 OK
> [('date', 'Mon, 03 Aug 2009 18:55:47 GMT'), ('content-length',
> '1074'), ('content-type', 'text/plain'), ('server', 'inets/5.1')]
>
> {"version":"1.1","id":0,"error":{"name":"JSONRPCError","code":500,"message":"Internal
> error","error":"{timeout,\n    {gen_server,call,\n
> [<0.248.0>,\n         {jsonrpc,<<\"call\">>,\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\",<<\"148\">>},\n
> {\"accept-encoding\",<<\"identity\">>},\n
> {\"host\",<<\"localhost:55672\">>}]}},\n
> {\"remote_port\",59596},\n
> {\"remote_peername\",<<\"0:0:0:0:0:0:0:1\">>},\n
> {\"scheme\",<<\"http\">>}]},\n
> [<<\"exchange.declare\">>,\n
> [0,<<\"gx.quincy.foo.g1\">>,<<\"fanout\">>,false,true,false,false,\n
>            true,[]]]}]}}"}}
>
> On Mon, Aug 3, 2009 at 12:51 AM, Cuong Le<cuonglb at facemain.com> wrote:
>> You must re-check exchange type of it (this is a topic exchange) and
>> consumer code (make exchange/queue, and bind exchange with queue).
>>
>> * gen_server make proc cast for a long time and until timeout it will arise
>> error {error, timeout}.
>>
>> Cuong
>>
>> On Fri, Jul 31, 2009 at 6:28 AM, Nathan Gray <n8gray at n8gray.org> wrote:
>>>
>>> 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
>>>
>>> _______________________________________________
>>> rabbitmq-discuss mailing list
>>> rabbitmq-discuss at lists.rabbitmq.com
>>> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>>
>>
>
>
>
> --
> http://n8gray.org
>



-- 
http://n8gray.org




More information about the rabbitmq-discuss mailing list