sendMessage with pinpoint has limitation? #4071
-
Hello, so, i tried to try pinpoint for send push message. cause my push codes are way too legacy and not sure is message even delivered or what. and pinpoint seems have dashboard plus much batter library so can make my code much cleaner. this is example of mine code const sendPinpointMessage = async ( msgList:Array<MessageRequest> ):Promise<any> => {
try {
if ( msgList.length > 0 ) {
const region = global.Config.PINPOINT_REGION;
const pinpoint = new Pinpoint({ region });
const resultList:Array<SendMessagesCommandOutput> = [];
for( const i of msgList ) {
const params:SendMessagesCommandInput = {
ApplicationId : global.Config.PINPOINT_APP_ID,
MessageRequest : i
}
try {
resultList.push( await pinpoint.sendMessages(params) );
} catch ( e ) {
global.log.debug(`failed to sendMessages `);
global.log.debug( JSON.stringify( e ) );
global.log.debug(`params is `);
global.log.debug( JSON.stringify( params ) );
}
}
}
// do something if not have list
} catch ( e ) {
global.log.error( e );
}
}
it working as i expected. i test receive success rate and its peak almost 100%. so i tried to test batch sending test. {
"name":"ThrottlingException",
"$fault":"client",
"$metadata":{
"httpStatusCode":400,
"requestId":"af5a94c1-0525-4645-b139-8001f677679",
"attempts":3,
"totalRetryDelay":994
},
"__type":"ThrottlingException",
"message":"Rate exceeded"
} okay, seems like i hit something of rate and got throttled.
but i never exceed that number yet. even not close. im just okay of 25000 notification per seconds, not 100 notification per seconds. what did i missing? can someone give me a hint? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
so, in case theres people like me come by, my error did not from pinpoint. seems like there's like limitation to invoke per seconds are exist to EACH SERVICES. im currently looking for using |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
so, in case theres people like me come by,
this is my conclusion.
my error did not from pinpoint.
that error was came from
aws-cli
response.seems like there's like limitation to invoke per seconds are exist to EACH SERVICES.
and each service has difference limitations.
this limitation can increase but you need to prove "why you need that and what did u tried", i guess.
ref: https://aws.amazon.com/ko/premiumsupport/knowledge-center/cloudformation-rate-exceeded-error/
im currently looking for using
SQS
, and send multiple message at singlesendMessage
function to preventing spamming api call,didnt test yet so my answer might not be correct answer.