RaisonWen / javapns

Automatically exported from code.google.com/p/javapns
0 stars 0 forks source link

Around 50,000 pushes, 50% pushes are not delivered... #192

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to send 50,000 pushes

What is the expected output? What do you see instead?
Expecting atleast 90% successful pushes

What version of the product are you using? On what operating system?
Latest version

Please provide any additional information below.
I am using around 30 threads to send more than 30-50 thousand pushes. Most of 
the pushes(50%) are not delivered...
pushedNotifications.getSuccessfulNotifications() returns around 20,000
pushedNotifications.getFailedNotifications() returns just around 100.
what happens to the rest???????????
There is no error in logs also....

Original issue reported on code.google.com by coder.a...@gmail.com on 10 Jul 2013 at 1:16

GoogleCodeExporter commented 9 years ago
Ubuntu operating system

Original comment by coder.a...@gmail.com on 10 Jul 2013 at 1:19

GoogleCodeExporter commented 9 years ago
This is the code I am using to send more than 50,000 notifications

@Override
public List<PushedNotifications> pushAlert(String environment, InputStream is,
            String password, Map<Integer, PushDevice> mapPushDevices, int numberOfThreads) throws JSONException, KeystoreException, CommunicationException, Exception {
        List<PushedNotifications> pushedNotifications = new ArrayList<PushedNotifications>();
        try {
            for (PushDevice pushDevice : mapPushDevices.values()) {
                PushMessage pushMessage = pushDevice.getPushMessage();
                Payload payload = new PushNotificationPayload(pushMessage.getMessage(), pushMessage.getBadge(), "default");
                Map<String, Object> fields = pushMessage.getFields();
                if (fields != null) {
                    for (Map.Entry<String, Object> entry : fields.entrySet()) {
                        payload.addCustomDictionary(entry.getKey(), String.valueOf(entry.getValue()));
                    }
                }
                PushedNotifications pushedNotification = null;

                if ("Sandbox".equals(environment)) {
                    pushedNotification = Push.payload(payload, is, password, Boolean.FALSE, numberOfThreads, pushDevice.getDevicePushTokens());
                } else {
                    pushedNotification = Push.payload(payload, is, password, Boolean.TRUE, numberOfThreads, pushDevice.getDevicePushTokens());
                }

                pushedNotifications.add(pushedNotification);
            }
        } catch (KeystoreException ex) {
            throw ex;
        } catch (CommunicationException ex) {
            throw ex;
        } catch (Exception ex) {
            throw ex;
        }
        return pushedNotifications;
    }

Original comment by coder.a...@gmail.com on 10 Jul 2013 at 1:33

GoogleCodeExporter commented 9 years ago
Please try latest build in the trunk.  Also, did you use the Feedback service 
to find out if Apple has issues with all your failed notifications?

Original comment by sype...@gmail.com on 11 Oct 2014 at 9:47