<div dir="ltr"><div>Hi,<br><br></div><div>I started working on implementing a client library for RabbitMQ based on STOMP 1.2 protocol, I&#39;m sharing the initial buggy version [1] with the community for feedback, suggestions and review.<br>
<br></div><div>For the initial version I&#39;ve implemented only authentication and publishing using receipts. I&#39;ll blog about this work with some history and background soon [2].<br></div><div><br></div><div>To test this library I wrote a load testing tool in golang which would run concurrent HTTP requests to an Openresty server. A handler runs Lua code for that request and uses the resty-rabbitmq library to sanitize, serialize and publish data to RabbitMQ&#39;s STOMP adapter.<br>
<br></div><div>With a noncurrent load test of total 1M requests, using the library a producer (in /example/) was able to publish all the messages to the broker without any errors. But in case of 
concurrent connections, I frequently got timeout errors or writing to 
closed socket errors. <br><br>How may I make publishing fault tolerant and avoid deduplicating messages in concurrent environment by correctly implementing states and reuse sockets using cosocket api pool? I set keepalive timeout on the cosocket tcp sock to 0 (no timeout as per wiki) and I saw exponential increase in socket consumed via the RabbitMQ management web interface, for a load of 100k requests, I saw fluctuations between 200-1200 consumed sockets with a lot of socket errors.<br>
<br>Ideas, flames? Thanks.<br><br>[1] <a href="https://github.com/wingify/lua-resty-rabbitmq">https://github.com/wingify/lua-resty-rabbitmq</a><br>[2] <a href="http://engineering.wingify.com/">http://engineering.wingify.com/</a><br>
<br></div><div>Regards,<br></div><div>Rohit Yadav</div></div>