Failed to create channel - connection timed out

83 views
Skip to first unread message

Vijaya Kumari Katta

unread,
Nov 3, 2022, 2:59:21 AM11/3/22
to pushy
Hi All,  Need help for this issue. Thanks in advance. 

I have below issue once in a while. It takes almost 30 sec after sending notification  and gets this warning. 


WARN 2022-10-03 23:16:50,755 436994467 com.eatthepath.pushy.apns.ApnsChannelPool [nioEventLoopGroup-2474-1] Failed to create channel
io.netty.channel.ConnectTimeoutException: connection timed out: api.push.apple.com/17.188.182.140:443
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:261)
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:829)


Below is the code I am using : 

private boolean sendNotification(ApnsClient client, final PushNotificationFuture<SimpleApnsPushNotification,PushNotificationResponse<SimpleApnsPushNotification>> sendNotificationFuture) throws InterruptedException, ExecutionException {

       boolean accepted = false

       try {

           final PushNotificationResponse<SimpleApnsPushNotification> pushNotificationResponse = sendNotificationFuture.get();

           

           if (pushNotificationResponse.isAccepted()) {

               accepted = true;

               log.info("Notification accepted by the APNs gateway: ");

           } else {

               log.error("Notification rejected by the APNs gateway: " + pushNotificationResponse.getRejectionReason());

               if (pushNotificationResponse.getTokenInvalidationTimestamp() != null) {

                   log.error("Notification rejected due to invalid timestamp: "+pushNotificationResponse.getTokenInvalidationTimestamp()); 

               }

           }

       } catch (final ExecutionException e) {

           //Exception Ignored - Retry will be attempted

           throw e;

       }

       finally {

           client.close();    

       }

       return accepted;

   }


Reply all
Reply to author
Forward
0 new messages