Git Product home page Git Product logo

Comments (14)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
Did you get anywhere with this?

Original comment by [email protected] on 3 Feb 2010 at 3:54

from javapns.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
Hi john, I was thinking of adding pooling myself until I realized that on the 
EC2 server I'm running the code on 
that once a connection has been created it takes only 1,2ms to send a 
notification, so unless you are sending 
500-1000 notifications a second there is no real need. It would be a nice 
implementation addition anyway. :)

Original comment by [email protected] on 26 Mar 2010 at 7:06

from javapns.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
i did get somewhere and it is running in production.  i'll try to get around to
attaching the patch.

the reason for the connection pooling isn't necessarily performance.  it is 
because
apple's docs specifically state that if you go connectionless, they could shut 
you
down as a DOS attack.  i'm not sure at what levels they start to become 
concerned,
but i didn't want to risk it.

Original comment by [email protected] on 26 Mar 2010 at 1:18

from javapns.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
Patch would nice, and easier to commit.

Original comment by [email protected] on 26 Mar 2010 at 9:35

from javapns.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024

Original comment by [email protected] on 27 Apr 2010 at 4:39

  • Added labels: Priority-Low
  • Removed labels: Priority-Medium

from javapns.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
Solved in 2.0 (see new javapns.notification.transmission) package.

Original comment by [email protected] on 9 Sep 2011 at 7:00

  • Changed state: Fixed

from javapns.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
I am writing an application to support notifications for 200K+ users. Where I 
need to send user specific notifications to users. So Push.alert will not help 
much. As it closes and opens connection each time. Which is not recommended by 
APNS.

Can you tell me what would be the best way to handle? Are you going to handle 
this in near future. 

Thanks in advance! 

Original comment by [email protected] on 22 Oct 2011 at 6:43

from javapns.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
Since this is a scenario that is likely happen for others, I have made some 
enhancements in the library.  I have added a PayloadPerDevice class which links 
a payload to a device.  You can call Push.payloads(..) with a list or an array 
of PayloadPerDevice objects.  This will allow you to push specific payloads to 
specific devices.

To try it out, you will need to get the latest build from the trunk 
(http://code.google.com/p/javapns/source/browse/trunk).

Let me know how it goes.

Original comment by [email protected] on 22 Oct 2011 at 8:15

from javapns.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
Thanks Sylvain! I love the work what you guys have done and planning to use it 
in my application.

Unfortunately, My application is more real time, where I need to send an alert 
immediately. Rather than waiting to having a list tokens and devices. So I 
prefer calling Push.alert(...)

I am looking for something, which will not close the connection immediately. 
rather reuse it for other alerts. Until it get closed or I am OK with 
maintaining it for for duration. I am concerned about the DOS attack.  Do you 
have any thoughts?

On an average I will using your framework to send 50K to 100K notifications in 
a day.

Keep up the good work. Thanks!

Original comment by [email protected] on 23 Oct 2011 at 4:43

from javapns.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
I suggest you take a look at the source code for the javapns.Push.payload(...) 
method.  It creates and opens a connection, pushes notifications and closes the 
connection.  You could do the same, except you wouldn't close the connection, 
but rather reuse it.

Original comment by [email protected] on 23 Oct 2011 at 5:34

from javapns.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
Hi! 
I'm working on a very similar application. It's like sms messaging so each 
payload needs to be sent immediately and connections reused. 

My idea is to implement a pool of connections and a dispatcher that decides 
(using some sort of algorithm maybe round robin) which slave has to send each 
notification.

What I don't know is how long it takes for the connection to close. I'll have 
to implement some sort of method to ask the SSLSocket if its still "logged" to 
APNS. Then I could implement a sort of monitor which checks that connections 
are up and reconnects the ones that fall.

Is my idea OK?

Original comment by [email protected] on 26 Oct 2011 at 6:52

from javapns.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
It all depends on what Apple allows you to do, or what it tolerates.  I'm not 
sure that maintaining several parallel connections open with Apple servers is 
something they'll tolerate (you wouldn't want to get banned because of 
overusing their resources), but that is purely speculative.

I guess you will have to try for yourself and find out what the reliability / 
tolerance thresholds are.

Original comment by [email protected] on 26 Oct 2011 at 7:22

from javapns.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
Well, it seems that not much work was needed to adapt the existing 
NotificationThread and related classes to support a connection pool.  So, if 
you want to try it, you can download the latest build from SVN and run this:

  AppleNotificationServer server = new AppleNotificationServerBasicImpl(keystore, password, production);
  NotificationThreads pool = new NotificationThreads(server, 3).start();

(notice the '3' above, which is the number of threads (ie connections) to 
create in the pool)

Next, you can add a notification to the next available queue (thread) by simply 
calling:

  pool.queue(payload, token);

Since the library automatically detects and recovers from connection errors, 
your connection pool should automatically recover if Apple drops the connection.

Original comment by [email protected] on 26 Oct 2011 at 9:58

from javapns.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
Thanks a lot! We are IN the PROCESS TO MIGRATE TO javapns 2.0
NEXT we'll try the connection pool.
Thanks again!

Original comment by [email protected] on 7 Nov 2011 at 6:18

from javapns.

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.