Giter Site home page Giter Site logo

Comments (5)

alanxz avatar alanxz commented on July 28, 2024

I understand why you want to have publish confirms turned off - the way I use them there's a substantial performance hit as client must wait for an entire round trip to the broker before proceeding.

Short Answer: I will not add this feature by simply turning off publisher confirms. (see long answer for an explanation why)

Long Answer:
The reason I decided to use publisher confirms is that it takes an asynchronous task of publishing and allows the client to treat it as a synchronous process.

Without publisher confirms handling AMQP errors in a single-threaded, non-event looped environment becomes tricky: When you publish without publisher confirms, the broker only sends something back to the client when an error occurs. Sometimes these errors result in the AMQP channel being closed, and continuing to use an AMQP channel after its been closed will result in the entire connection being shut down.

You run into the same issues with the immediate and mandatory flags on the basic.publish.

I have given thought to augmenting the API to allow for asynchronous publishing (e.g, BasicPublish returns a boost::future<> of some sort) improving the throughput of the client library by allowing programs to continue sending messages before the client library receives a publisher confirm.

from simpleamqpclient.

chenyujian avatar chenyujian commented on July 28, 2024

i think you are right.
i think asynchronous publishing is better than simply turning off publisher confirms.
in my win xp os,when i use this library, publishing msg rate is about 800msg/s,and in no confirm mode rate raises to about 15000msg/s. i tested asynchronous publishing in other language, publish rate is about 12000msg/s

from simpleamqpclient.

luca3m avatar luca3m commented on July 28, 2024

I noticed a good performance boost removing confirm from BasicPublish. Do you you have some ideas about how to implement it? Right now I've simply tried to comment these lines from 537 to 552.

I imagine that you prefer something better, anyway commenting these lines are there any side effects on the library?

from simpleamqpclient.

alanxz avatar alanxz commented on July 28, 2024

Please read my comment above.

Repeating what I stated above: I will not disable publisher confirms in SimpleAmqpClient. I am open to being more creative about AMQP-channel usage from within the library to improve publisher performance. Or perhaps by adding an API to publish several messages at once.

If you're really bent on disabling publisher confirms in SimpleAmqpClient, you also need to disable publisher confirms by disabling confirm.select when creating new channels here).

from simpleamqpclient.

luca3m avatar luca3m commented on July 28, 2024

Yes, I've read your comment, I was asking some details more about how you would improve publish efficiency.

Anyway I prefer no-ack approach, thank you for your hint!

As a reference for other readers, on my branch you can find this feature (pretty simple) publish-noack

from simpleamqpclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.