Closed alexbuijs closed 7 years ago
From the README:
Thread-Safety [...] Errors in the underlying socket loop thread will be raised in the main thread at unexpected execution times, unless you specify the :error callback on the Client (recommended).
and the example provided there is:
client.on(:error) { |exception| puts "Exception has been raised: #{exception}" }
Does this cover your use case?
By the way, there's an open PR (https://github.com/ostinelli/apnotic/pull/28) to add support for token auth, maybe you'd like to contribute?
BTW there is an issue discussing this, here it is if you'd like to take a look: https://github.com/ostinelli/net-http2/issues/4
Thanks, I'll test it out and will look at the PR!
I cannot reproduce the 'Connection reset' error manually. I suspect the problem is that I open and close the connection to APNS many times in a short time frame. Apple is probably denying requests: APNs treats rapid connection and disconnection as a denial-of-service attack.. As your apnotic gem already has a solution that deals with sending in pools from sidekiq I will try to use that with JWT.
Adding the error callback prevented sidekiq from crashing and reusing the client helped with the connection reset issue. Thanks!
Hi, I am using this gem to send push notifications through APNS with a JWT token. Because I am using the JWT token and not the certificate authentication, I am using this gem directly instead of apnotic. Today was the first day we took this approach with the latest version (0.15.0) to production. After several hundreds of sent notifications, Sidekiq unfortunately crashes:
I have read several issues like this (e.g. https://github.com/ostinelli/apnotic/issues/17), but not with using this gem directly. Am I doing something wrong? I am using the synced approach like this:
Thanks for any pointers to solve this issue!