Comments (11)
You can already consume asynchronously by setting timeout to 0 in BasicConsumeMessage. Async publish could be achieved by adding an async flag to BasicPublish and some pollable methods to Channel, eg IsPublished, GetNextConfirmation, etc.
from simpleamqpclient.
A while ago I put some thought into what it would take to add async support for messages delivered via consumer, (and other various other events). When I first wrote SimpleAmqpClient I did so to provide an easy-to-use interface when making synchronous RPC-style calls. I wasn't looking to get the best performance out of the protocol. With that constraint the internal bits of SimpleAmqpClient were architected in such a way to hide the async portions of the AMQP protocol.
To add the async bits back to SimpleAmqpClient would require rethinking the core of SimpleAmqpClient to run a thread internally to manage the rabbitmq-c structures, then all of the API calls would need to talk to this thread.
At the time I didn't see a whole lot of demand from users for this sort of feature, that said, if there is new demand maybe its time to re-think adding this feature to SimpleAmqpClient.
from simpleamqpclient.
I see. we are looking for high performance, and use our cores to do some other operations instead of waiting for these synchronous calls. thread is an option, but if we get async support, that would be really great.
from simpleamqpclient.
Noted.
from simpleamqpclient.
Hi,
I would like an async API too. How do you think is better to implement it? Boost provides Boost::asio with asynchronous sockets. Is it a good option or rabbitmq-c has yet something to manage asynchrony?
from simpleamqpclient.
SimpleAmqpClient wraps rabbitmq-c and rabbitmq-c currently does nothing to provide a good interface to the asynchronous parts of the AMQP protocol.
Since SimpleAmqpClient doesn't use sockets directly, boost::asio would not be a good option to use with SimpleAmqpClient. Currently I believe the best way forward to get useable support for the asynchronous parts of AMQP is to do a bit of re-architecting of the rabbitmq-c library to support both the various methods available to do network-based async-IO, and provide a useable async API .
from simpleamqpclient.
I've read some more details about code of rabbitmq-c and SimpleAmqpClient, for me probably it's easier to use asio sockets and use rabbitmq-c only for protocol parsing.
I'm doing some other experiments and eventually I'll get back on this issue if somebody it's interested.
from simpleamqpclient.
Did you come up with a solution for this? I'd like to have a consumer in a seperate thread, but it doesnt sound like it supports it.
from simpleamqpclient.
I used this library https://github.com/CopernicaMarketingSoftware/AMQP-CPP, no good luck but probably now it's better than two years ago.
from simpleamqpclient.
Is there any progress on providing async support. We are trying to use simpleamqpclient
for RPC purposes. Performance is not great. I really really like the simplicity nature of
this client but, we need performance as well. Yes, async support would be wonderful.
from simpleamqpclient.
@alosya - are you concerned about performance in publishing messages or receiving messages?
from simpleamqpclient.
Related Issues (20)
- How to quit basicsumemessage when a quit signal coming ?
- when set message HeaderTable, the ReplyTo property Settings have been cleared. HOT 3
- Is This Dead? HOT 3
- Classify Exceptions
- Consumer stops consuming inside Docker container (after some idle period) HOT 1
- fatal error: SimpleAmqpClient/SimpleAmqpClient.h: No such file or directory HOT 1
- Channel::OpenOpts::FromUri results in Access violation reading location 0x0000000000000000. HOT 3
- Version 2.4 compatibility with newer Rabbit servers HOT 4
- Latest NuGet of SimpleAmqpClient HOT 1
- Linking the library on Linux using cmake
- Keep alive for long running connections HOT 3
- App crashes when connection closes HOT 2
- `std::bad_alloc()` when header table is empty
- Handle node failure in RabbitMQ cluster
- Support for Quorum queues
- Bug,Exclusive always true!
- Channel can't open
- Compiling with boost 1.82 generates deprecation warnings
- On the issue of creating channels HOT 7
- Test Mate C++ VSCode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simpleamqpclient.