11
Views
2
Comments
[Amazon Simple Queue Service (SQS)] AWS SQS Component is throwing an exception for "Message_Receive" action.
amazon-simple-queue-service-sqs
Service icon
Forge asset by OutSystems
Application Type
Service

Hi

I have an application where we are using "Message_Receive" action of AWS SQS component to retrieve the data. But when the queue is empty it is throwing an exception given below.

"Object reference not set to an instance of an object." 

I guess this is not being handled by this component and Outsystems action is throwing an exception.

AWS SQS has an action called "GetQueueAttributes" which is not present in this component. This can be used before calling "Message_Receive" to check if the queue is empty.

https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/example_sqs_GetQueueAttributes_section.html


I would request the Outsystems  team to add the "GetQueueAttributes" action in the component or fix the "Message_Receive" action.


Any other solution which i can implement to solve this issue.


BR Syed

2024-08-08 11-19-43
Julien Crepin

Hello, 
We updated the AWS SQS to the latest version and since we're facing the same problem. 


Any reaction from Outsystems is foreseen on this topic ? @Anthony Ouwehand
Any help is welcome. 
thanks

UserImage.jpg
Syed Mohammad

Hi Julien

I have applied a workaround for this issue, 

Wrap "Message_Receive" action and use it.

Create a Server Action (e.g. SafeMessageReceive) that:

  • Calls Message_Receive inside.
  • If it succeeds, just return the list of messages.
  • In exception handler you can check if the exception raised is "Object reference not set to an instance of an object." then you can end the flow else raise an exception from here.

It worked for me, you can try this.

Note: The concrete solution will be Outsystems adding "GetQueueAttributes" in this component, until then we can use this workaround.


BR Syed

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.