Comments (2)
@deepj could you share a sample repo with the issue? I can try to take a look so that it works, if each one of the processes has its own NATS connection I think it should work as you mention...
from nats-pure.rb.
@wallyqs sorry for so late answer. I guess my original problem was/is a duplication of #20.
In the end, I guess my problem could be reproduced using this script
nats-publisher.rb
nats = NATS::IO::Client.new
nats.connect('nats://localhost:4222')
nats.publish('foo', '{}')
In my cases this sends a message and I could see something like
[3069] 2020/12/10 00:33:53.808539 [DBG] [::1]:55127 - cid:2 - Client connection created
[3069] 2020/12/10 00:33:53.809282 [TRC] [::1]:55127 - cid:2 - <<- [CONNECT {"verbose":false,"pedantic":false,"lang":"ruby2","version":"0.6.2","protocol":1}]
[3069] 2020/12/10 00:33:53.809315 [TRC] [::1]:55127 - cid:2 - <<- [PING]
[3069] 2020/12/10 00:33:53.809318 [TRC] [::1]:55127 - cid:2 - ->> [PONG]
[3069] 2020/12/10 00:33:53.809814 [TRC] [::1]:55127 - cid:2 - <<- [PUB foo 2]
[3069] 2020/12/10 00:33:53.809864 [TRC] [::1]:55127 - cid:2 - <<- MSG_PAYLOAD: ["{}"]
[3069] 2020/12/10 00:33:53.810866 [DBG] [::1]:55127 - cid:2 - Client connection closed: Client Closed
But time from time I could see only
[3069] 2020/12/10 00:33:53.808539 [DBG] [::1]:55127 - cid:2 - Client connection created
[3069] 2020/12/10 00:33:53.809282 [TRC] [::1]:55127 - cid:2 - <<- [CONNECT {"verbose":false,"pedantic":false,"lang":"ruby2","version":"0.6.2","protocol":1}]
[3069] 2020/12/10 00:33:53.809315 [TRC] [::1]:55127 - cid:2 - <<- [PING]
[3069] 2020/12/10 00:33:53.809318 [TRC] [::1]:55127 - cid:2 - ->> [PONG]
[3069] 2020/12/10 00:33:53.810866 [DBG] [::1]:55127 - cid:2 - Client connection closed: Client Closed
The above example can be solved by calling nats.close
in the end. But sometimes in Rails process I'm sending many messages some of them are lost sometimes. Very brief example from one Rails controller.
def create
Model.find_each do |row|
nats.publish('foo', row.to_json)
end
end
Where nats.publish
is a direct forwading to NATS::IO::Client#publish
. Interesting this doesn't happen with other clients such as nats.js
or nats.net
. I'm not sure if I'd call flush
after x messages. If so, after many? :)
from nats-pure.rb.
Related Issues (20)
- KV History
- Review and verify that on create of streams and consumers, naming errors are surfaced in the client
- Default Error Listener
- Don't Auto ack when Ack Policy is No Ack
- Implement Allow consumer filter subject to be updated
- Implement Support Consumer Retry Backoff and Nak delays
- Implement StreamInfo request changes to retrieve subjects
- Implement Bind subscribe validation
- Implement new pull consumer and ephemeral consumer options
- Implement MaxBytes for pull requests
- pull_consumer behaving oddly
- Implement support for Jetstream consumers with multiple subject filters
- Possible bug in nats-pure.rb/lib/nats/io /client.rb#1828 HOT 2
- NATS connection with username / password with URI Escape characters fails
- List of keys from jetstream KV
- Implement Consumer Pause
- Alternate Prefixes
- Flow Control
- Nats-Expected-Last-Sequence
- Nats-Expected-Last-Msg-Id
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 nats-pure.rb.