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

Cuong Le cuonglb at facemain.com
Thu Aug 6 05:36:53 BST 2009


Hi Nathan,

because you're using json_rpc synchronous requests - call, you must
keep-alive it with steps 5s/request.
It think you have to set : session timeout = 5s (gen_server:call default
time out is 5000ms).

resp = proxy.rpccall("/rpc/rabbitmq", "open", ["guest", "guest",*5*,"/"])

i think you should not set http channel session timeout to large

Cuong,

This is result dump on my server when run *stupidRpc.py* script :

==================================
Calling /rpc/rabbitmq, open, ['guest', 'guest', 5, None]

connect: (localhost, 55672)
send: 'POST /rpc/rabbitmq HTTP/1.1\r\nHost:
localhost:55672\r\nAccept-Encoding: identity\r\nContent-Length:
84\r\nContent-Type: application/json; charset=UTF-8\r\nAccept:
application/json\r\nUser-Agent: python\r\n\r\n'
send: '{"version": "1.1", "params": ["guest", "guest", 9, null], "id": 0,
"method": "open"}'
-----------------------
reply: 'HTTP/1.1 200 OK\r\n'
header: Server: inets/5.0.13
header: Date: Thu, 06 Aug 2009 03:17:48 GMT
header: Content-Length: 80
header: Content-Type: text/plain
body:
{"version":"1.1","id":0,"result":{"service":"B959C017343A362D4539668F9D6BA37F"}}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

got channel: B959C017343A362D4539668F9D6BA37F

==================================
Calling /rpc/B959C017343A362D4539668F9D6BA37F, poll, []

send: u'POST /rpc/B959C017343A362D4539668F9D6BA37F HTTP/1.1\r\nHost:
localhost:55672\r\nAccept-Encoding: identity\r\nContent-Length:
59\r\nContent-Type: application/json; charset=UTF-8\r\nAccept:
application/json\r\nUser-Agent: python\r\n\r\n'
send: '{"version": "1.1", "params": [], "id": 1, "method": "poll"}'
-----------------------
reply: 'HTTP/1.1 200 OK\r\n'
header: Server: inets/5.0.13
header: Date: Thu, 06 Aug 2009 03:17:52 GMT
header: Content-Length: 36
header: Content-Type: text/plain
body:
{"version":"1.1","id":1,"result":[]}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


On Thu, Aug 6, 2009 at 1:39 AM, Nathan Gray <n8gray at n8gray.org> wrote:

> Hi Cuong,
>
> On Tue, Aug 4, 2009 at 8:20 PM, Cuong Le<cuonglb at facemain.com> wrote:
> > Hi Nathan,
> >
> > Ah ha, because HTTP Channel was closed by timeout handle_info
> spontaneous.
> > You must keep-alive it until make json_rpc call close it.
>
> I'm afraid that's not it.  The HTTP channel times out after 15
> seconds, but the timeout that's giving me headaches happens after only
> 5 seconds.
>
> BTW, I set things up on my Ubuntu machine, using the same versions of
> everything and got the same problem.  I also tried out the javascript
> example code and it seems to work fine, so I guess I'm just doing
> something wrong on the client side.  I'm attaching my VERY simple (50
> line) python client code.  Can somebody take a look at it and see if
> they can spot the problem?
>
> > Can you chat with me? at : cuonglb at jabber.org
>
> Sure, I'll try to catch you.  Thanks!
>
> Cheers,
> -n8
>
> --
> http://n8gray.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20090806/4f1e0a89/attachment.htm 


More information about the rabbitmq-discuss mailing list