[Amazon SQS Connector] Login Behavior

Forge Component
(11)
Published on 2019-10-15 by Guilherme Pereira
11 votes
Published on 2019-10-15 by Guilherme Pereira

Thanks for the component.


I have a question.


In the Message_Send server action in the demo espace (AmazonSQS), you are calling the Sqs_Login action before the Sqs_SendMessage action. How does this login work? Does it login every time we call the Message_Send action even with the same credentials? Or does it reuse any login session to not make repeated calls to the Amazon server for login again?


I am not a .Net guy and hence could not dig deeper myself to find this out.


I would like the Login action to reuse the session and not make unnecessary service calls.

Hi Ali,

The Sqs_Login action from the AmazonSQSConnector, creates a singleton object and saves the 3 input parameters (ServiceURL, AccessKeyID, and SecretAccessKey) as SqsCredentials. 

The AWS SQS service as such does not have a Login action, so there is no login performed. There is no state, no session.

https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/Welcome.html

I used it in projects as is sending/receiving a huge amount of message. I didn't feel the need to adjust the code provided by the Forge component. 

But you could make your code to call the Sqs_Login action once and then other SQS actions, that will work and minimizes the number of calls to Sqs_Login to the bare minimum. How much performance you gain I do not know.

Regards,

Daniel

Solution

Thanks Daniël for stepping in.

Ali Ahsan, Daniël summuarized it perfectly. The login is an abstraction of the component to save those 3 parameters that are required for executing the actions.

There's no relevant overload in using it, since it doesn't imply an AWS call. 

Solution

Thanks, Carlos and Daniël,


I also tested it by putting in the log messages before and after the login action and it seems to not make any network external calls.