Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Timeout error for AWS SNSClient Publish request

Here is the piece of code :

                        //Publishing the topic
                        snsClient.Publish(new PublishRequest
                        {
                            Subject = Constants.SNSTopicMessage,
                            Message = snsMessageObj.ToString(),
                            TopicArn = Settings.TopicArn
                        });

I am getting the below error :

The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.

And here is the screenshot of detailed error: enter image description here

But not able to get an idea how to solve this. Any hint or link will helpful.

like image 914
choudhury smrutiranjan parida Avatar asked Oct 15 '15 07:10

choudhury smrutiranjan parida


People also ask

How do I Publish a SNS message?

Sign in to the Amazon SNS console . In the left navigation pane, choose Topics. On the Topics page, select a topic, and then choose Publish message. The console opens the Publish message to topic page.

What is the maximum possible size of a single message sent through Amazon SNS?

Today, we are increasing the maximum allowed payload size for the Amazon Simple Queue Service (SQS) and the Amazon Simple Notification Service (SNS) from 64 KB to 256 KB.

Can SNS lose messages?

When the delivery policy is exhausted, Amazon SNS stops retrying the delivery and discards the message—unless a dead-letter queue is attached to the subscription. For more information, see Amazon SNS dead-letter queues (DLQs).

Does AWS SNS guarantee delivery?

Q: Does Amazon SNS guarantee that messages are delivered to the subscribed endpoint? Yes, as long as the subscribed endpoint is accessible. A message delivery fails when Amazon SNS can't access a subscribed endpoint, due to either a client-side or a server-side error.


1 Answers

We had the exact same issue happen to us. We got this error about 40 times a day, which was less than 0.1% of the successful push notifications we sent out.

Our solution? Update the AWSSDK NuGet package from 1.5.30.1 to 2.3.52.0 (the latest v2 release for ease-of-upgrade). As soon as we updated, the errors stopped happening. I looked through lots of release notes and couldn't find anything specifically mentioning this issue. We have no idea why the update worked, but it did.

I hope this helps you and anyone else fix this issue.

like image 198
ivanmartinvalle Avatar answered Sep 21 '22 11:09

ivanmartinvalle