Comments (5)
I'm starting multiple PRs on this, to see how the interface would feel
from pulsar-rs.
I'm running into another issue: it is not possible to send acks asynchronously, because there's no answer to that message: ConnectionSender
has a channel to connection::Sender
, and then the sender will receive from that channel and send message on the TCP connection. There's no way to await until the message is actually sent, since we can either call unbounded_send
on the channel (sync interface) or using SinkExt::send
but it requires mutable access (it should be possible to make it mutable).
Right now, for most messages, awaiting is done by sending the message with a request key, giving a oneshot sender to the connection::Receiver
instance, and waiting on that oneshot channel.
Since connection::Sender
is mainly wrapping the connection's sink, it should be possible to remove it and directly hold the sink in the ConnectionSender
from pulsar-rs.
ok, so, after more investigation, there's an issue with the UnboundedSender
in Ack
that is used to communicate with the Ackhandler
: it does not detect that the AckHandler
dropped the receiver, so calling Ack::ack()
does not fail. Closing the channel from the sender side before calling close_consumer()
is enough to make ack()
fail as expected
from pulsar-rs.
with #82 it gets more manageable: acknowledgements are done only through the consumer, so we cannot try to ack a message after the consumer was dropped.
Possible issues:
- it is not possible to acknowledge messages after converting the consumer to a stream (with method like
take()
, etc). I believe the main case will be inwhile let Some(message) = consumer.next.await { }
, but still, we should not forbid other patterns. For cases like this, we could add options to either:- automatically acknowledge messages as they're taken from the stream
- send a cumulative ack for all previously seen messages when the consumer drops
- provide a separate object that could acknowledge messages, like the previous
Ack
, but linked to theConsumer
, not to the message
- acks are not batched now, but I'm planning to add an ack methods that take a list of messages or message ids to acknlowedge all of them at once
from pulsar-rs.
done in 1.0 release
from pulsar-rs.
Related Issues (20)
- Why client redirect to ssl connection? HOT 1
- Consumer stucks in reconnections HOT 9
- Consumer `try_next` stops producing messages, but consumer is still processing messages internally
- Producer and Consumer IDs
- Limit producer batch messages by size in bytes as well HOT 2
- Connection error: bytes remaining on stream
- Timeout in batching
- Negative unackedMessages in consumers
- Unable to cleanly close a consumer without unsubscribing from a topic HOT 2
- Mutex in producer::TopicProducer is unnecessary
- Concretize types for client building
- TLS BAD_PACKET_LENGTH Error
- Authentication Errors swallowed and never surfaced to places where you could handle the error HOT 1
- 在使用正则订阅的时候提示没有权限
- Please add an option to skip invalid metadata instead of shutdown the consumer
- Missing `batchingMaxPublishDelay` option
- migrate `async_rustls` to `futures-rustls` HOT 1
- If the producer message generated by pulsar client is encapsulated as a function, only one message can be sent in a topic
- Reading the latest message?
- Channel closed issue during consumption since #312 HOT 13
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 pulsar-rs.