I'm unable to receive any of my push notifications sent by either Amazon SNS or Pinpoint. At one point it used to work via the push notification section on AWS however has stopped for some reason. I've tried using pinpoint via a lambda function for it to work but to no avail. I should add also that Pinpoint is my preferred method for sending the push notifications via lambda, as the goal for my project is to have triggered push notifications.
Lambda function using pinpoint to send push notifcation
I'm using Android Studio and I wonder if the problem lies there? as I am using the correct token that my android studio app received so the issue isn't there.
Picture of my token in the android studio
Proof of token used in AWS SNS
Does anyone know what it may be? I would greatly appreciate any help received
Also if anyone knows how to send a notification to all users of my app that would be brilliant.
Related
Below is the program that I am using to publish a message to SNS. There is no issue when I execute this program(simple Java or Spring boot) in my local system. The message is published on the topic.
But, the actual program runs inside a thread in a spring boot project. The thread runs every 1 minute. Whenever the thread runs, the below program has to publish the message. This spring boot project deployed inside a standalone Unix server. From the server, it is not publishing messages. There is no exception. The logs are showing a successful handshake to the Amazon network.
I tried AmazonSNS and SnsClient classes as well.
AmazonSNSAsync snsClient1 = AmazonSNSAsyncClient.asyncBuilder()
.withCredentials(new AWSStaticCredentialsProvider(
new BasicAWSCredentials("access-key",
"secret-key")))
.withRegion("us-east-1")
.build();
log.info("STATUS: snsClient1 formed");
PublishRequest publishReq =
new PublishRequest()
.withTopicArn("sns_topic-arn")
.withMessage("mes: "+message);
log.info("STATUS: publishReq formed");
snsClient1.publishAsync(publishReq);
I tried the below things already.
moved the program out of the thread
tried with a new topic
used the latest dependency of SNS
However, when I published a message from the Unix box using AWS CLI, the message was published successfully.
Did anyone face a similar issue? If not, you can share any alternative way to hit the SNS from a Java program if you know.
The issue is partially fixed. AWS SDK was throwing an error, not an exception. That was the cause of the code block. Once, I catch with the "Throwable" keyword, the program is not stopping.
Later, I used the bom concepts to avoid the transitive dependency version conflicts and converted all the AWS SDK 1 code into SDK 2 code. Now, the message is posted on the SNS topic. But, the weird thing is that SDK2 also throws a similar error. I am trying to fix it.
Reference:
https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html
https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/javav2/example_code/sns/src/main/java/com/example/sns/PublishTopic.java
Meanwhile, you can track the issue on the below page as well.
https://github.com/aws/aws-sdk-java/discussions/2867
Before I waste to much time on this I was wondering is it technically possible to send from a Lambda a custom event to Event Bridge to SNS to Chatbot to Slack.
I have written all the infrastructure and I know that it works for non custom messages. So if I have a message with a source of aws.lambda in the rule then when I deploy the Lambda I get the eventual Slack notification.
However if I change the source to a custom source in the rule and use that in the code of the Lambda I get from the SDK call success but no Slack message. From turning on the Chatbot logging I get the following message Event received is not supported (see https://docs.aws.amazon.com/chatbot/latest/adminguide/related-services.html )
I am sort of hoping against hope that I am not sending something in on the SDK put events call that this integration although the api call only offers a limited amount of what you can change.
I did notice that the message sent to Slack from a standard event is much bigger that the one sent as a custom event.
Realistically its just looking that the Chatbox Slack integration is an extremely limited one confined to standard events on a subset of services.
Can someone confirm if this is possible or am I right in my conclusion about the limitations of the integration.
We are using twilio for sending messages but as Twilio(Text Messaging) integration was shutting down we deployed the integration using cloud run by following steps from https://github.com/GoogleCloudPlatform/dialogflow-integrations/tree/master/twilio#readme
After deployment messages were sending successfully but now suddenly we are getting errors in twilio like
Some messages are sending successfully and for some messages we are getting error.can anybody help me in this.thanks in advance
According to Twillio docs there might be some possible causes for Unreachable destination handset
1.The destination handset you are trying to reach is switched off or otherwise unavailable.
2.The device you are trying to reach does not have sufficient signal
3.The device cannot receive SMS (for example, the phone number belongs to a landline)
4.There is an issue with the mobile carrier
Possible Solutions
The first step to troubleshooting this issue is to attempt to replicate the problems.
Attempt to send another test message to this user via a REST API request, or through the API Explorer in the Twilio Console.
I intend to write software that posts daily feeds using SubmitFeed, and while planning to do so, I have seen in the documentation that I get some response from Amazon, possibly way before the actual parsing is complete. When I know that the operation has been completed, I need to call GetFeedSubmissionResult, however, the problem is that I need to find out somehow when the submission has finished. I could poll using GetFeedSubmissionList until the status is complete, but this would waste resources and is hacky. The way I would like to go is to use Amazon SNS and get notifications from FeedProcessingFinishedNotification.
However, I don't know how I could use Amazon SNS. Even though I read into the docs, I don't really know how I could use this. I suppose that something would need to run in my Linux CentOS or my Wildfly/Jboss which would "see" that a message has arrived and as a result would trigger the execution of a code I would intend to execute when such a push notification arrives. However, I do not know how I need to do this. How can I properly receive Amazon SNS push notifications at my Linux CentOS and Wildfly/Jboss so a custom Java code I write would be executed?
P.S.
This is a link which deals with RedHat and Maven: https://access.redhat.com/documentation/en-us/red_hat_jboss_fuse/7.0-tp/html/apache_camel_component_reference/aws-sns-component
However, reading it it's not clear to me how I can receive messages from Amazon, like an order has been placed on a product.
This article about CLI: https://docs.aws.amazon.com/cli/latest/userguide/cli-services-sns.html
describes how to subscribe using the email protocol. Reading about subscription protocols I have found this article: https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html
It seems that if I choose an HTTPS address, then the messages would be requests to that address. I'm really confused about this.
I want to get notifications by email for errors on my google cloud service.
It seemed pretty easy to setup. I just hit turn on notifications in Error Reporting in Stackdriver for all services (I only have 1 service).
I created some errors for testing, but didnt receive any emails.
Went into alert policy and profiles and added email notification as a channel. Still not notifications via email.
What am I doing wrong?
I think the best way to check if the notification is actually being sent is to post a test error message manually to the error reporting API.
First, verify that error notifications are available for the project, and then, run the following command on your cloud shell:
gcloud beta error-reporting events report --verbosity=debug --service Manual --service-version test1 \
--message "java.lang.TestError: msg
at com.example.TestClass.test(TestClass.java:51)
at com.example.AnotherClass(AnotherClass.java:25)"
You should receive an email from StackdriverNotifications-noreply#google.com
If you receive the notification for the test, your other errors might be misconfigured. If you don't receive it, then you might need to verify that the noreply address is not being blocked by your provider/filters.