I sporadically get connection refused errors. This happens in both the sandbox and production environments. I have all the required certificates and the ports are open through the firewall. This happens both when I send a message and contact the feedback service.
Here's an example of my code that connections to the feedback service:
And the error that is returned is:
om.notnoop.exceptions.NetworkIOException: java.net.ConnectException: Connection refused: connect
at com.notnoop.apns.internal.Utilities.wrapAndThrowAsRuntimeException(Utilities.java:285)
at com.notnoop.apns.internal.ApnsFeedbackConnection.getInactiveDevices(ApnsFeedbackConnection.java:90)
at com.notnoop.apns.internal.AbstractApnsService.getInactiveDevices(AbstractApnsService.java:132)
at com.notnoop.apns.internal.ApnsServiceImpl.getInactiveDevices(ApnsServiceImpl.java:36)
at com.efirstbank.pushnotification.rest.server.services.messaging.AppleMessagingService.getInactiveDevices(AppleMessagingService.java:87)
If I continue to run my code, I will get a valid connection.
Is this typical behavior? Should I expect that sometimes Apple will refuse my connection? Or should this work most of the time?
I sporadically get connection refused errors. This happens in both the sandbox and production environments. I have all the required certificates and the ports are open through the firewall. This happens both when I send a message and contact the feedback service.
Here's an example of my code that connections to the feedback service:
ApnsServiceBuilder builder = getBuilder() .withCert("my cert path", my cert pw") .withAutoAdjustCacheLength(true) .withDelegate(getApnsErrorDelegate()) .withAppleDestination(isProductionDestination()); apnsService = builder.build(); service.getInactiveDevices();
And the error that is returned is: om.notnoop.exceptions.NetworkIOException: java.net.ConnectException: Connection refused: connect at com.notnoop.apns.internal.Utilities.wrapAndThrowAsRuntimeException(Utilities.java:285) at com.notnoop.apns.internal.ApnsFeedbackConnection.getInactiveDevices(ApnsFeedbackConnection.java:90) at com.notnoop.apns.internal.AbstractApnsService.getInactiveDevices(AbstractApnsService.java:132) at com.notnoop.apns.internal.ApnsServiceImpl.getInactiveDevices(ApnsServiceImpl.java:36) at com.efirstbank.pushnotification.rest.server.services.messaging.AppleMessagingService.getInactiveDevices(AppleMessagingService.java:87)
If I continue to run my code, I will get a valid connection.
Is this typical behavior? Should I expect that sometimes Apple will refuse my connection? Or should this work most of the time?