1. Kresimir Popovic
  2. as3awsSDK
  3. Issues
Issue #20 resolved

delete doesn't work

Danny Miller
created an issue

Great project, but the delete functionality doesn't seem to work (Also doesn't work in the AWSAdmin tool)

The messages just keep coming back... I know there are rare exceptions on amazon when it can send the same message, but it really just doesn't delete the messages ever...

Comments (8)

  1. Kresimir Popovic repo owner


    thank you for reporting. I will check delete message action.

    One thing to mention: For successful message delete latest recipient handle must be used. Recipient handle is recreated each time when someone fetches a message.

    Scenario sample (AWSAdmin tool):

    1. List messages in "Receive message table"

    2. Choose message to delete (if someone fetched this message after you then your recipient handle is not valid any more)

    Best Regards,


  2. Kresimir Popovic repo owner

    Hello, I have found a bug in deleteMessage action. I will fix it. I plan to release a new SDK version in few days. Is this OK for you ?


    a) Do you like Flex SDK implementation ? Is it simple to use from developer perspective ?

    b) Is Wiki enough detailed how to use API ?

    c) I'm currently working on implementation of CloudWatch service to be part of SDK so that users can check AWS/SQS metrics and statistics.

    Best Regards,


  3. Danny Miller reporter

    a) it is good if i were using flex, but i'm using flash cs 5.5, so i had to do a bunch of workarounds (like importimg flex sdk mx library) in order for it to work. but i got it working for now. b) would be great if wiki could provide code examples. i had to look at the source of your air appp to ensure i was calling delete message properly. also it too me a looking at your air app to realize that i didnt need to parse the xml response myself- so code example of that would be great. i love it when wiki's have code examples for specific tasks. c) sounds cool

    as for the library itself, passing in function callbacks is nice, but a little bit unusual compared to other libraries. most have you add an event listener and then the library dispatches events. i don't mind this approach though, but i hope you ensure you delete/clean up the listeners you have ib your library when appropriate. I built an EventManager class (search EventManager as3, my site is k2xl one) you might want to consider using as a replacement for your addevent listener calls in your library to ensure the listeners are deleted.

    also, i would advise removing trace actions for deployment! if i want to see output i could check the raw date.

    thanks for quick response. if you could commit a fix as soon as possible for deleteMessage that would be super helpful for the project i'm working on!

  4. Kresimir Popovic repo owner


    wiki samples: https://bitbucket.org/Kresimir/as3awssdk/wiki/Home (see "as3awsSDK SQS supported actions". You have 11 links named by every action). sample for deleteMessage action: https://bitbucket.org/Kresimir/as3awssdk/wiki/DeleteMessage


    Regarding function callbacks...I wanted to spare developer for manually define type of event and to work out-of-box. I could add function "removeEventListeners()". It could look like this:

    var client: AmazonSQSClient = null;
    * Function executes delete message.
    public function deleteMessage(): void {
       var awsCredentials: BasicAWSCredentials = new BasicAWSCredentials("your access key id", "your secret key");
       var clientConfig: ClientConfiguration = new ClientConfiguration();
       clientConfig.endpoint = "sqs.eu-west-1.amazonaws.com"; (mandatory parameter)
       clientConfig.protocol = ProtocolEnum.HTTPS; (optional parameter)
       clientConfig.signatureExpires = 60; // signature expires after 60 seconds (optional parameter)
       clientConfig.userAgent = "Amazon SQS service tool 1.0.0"; (optional parameter - only for AIR Runtime)
       client = new AmazonSQSClient(awsCredentials, clientConfig);
       var request:DeleteMessageRequest = new DeleteMessageRequest();
       // 123456789012 - your account id. It is optional.
       request.setQueueUrl("https://sqs.eu-west-1.amazonaws.com/123456789012/TestQueue"); // mandatory parameter
       //request.setQueueUrl("https://sqs.eu-west-1.amazonaws.com/TestQueue"); //  mandatory parameter
                                 auMZc8ZRv37sIW2iJKq3M9MFx1YvV11A2x/KSbkJ0="); // mandatory parameter
        client.deleteMessage(request, resultHandler, faultHandler);  // event listeners are created automatically!        
    * Asynchronous positive response.
    private function resultHandler(event: CompleteActionEvent): void {
       client.removeEventListeners(); // shutdown all listeners!
       var result: DeleteMessageResult = event.result as DeleteMessageResult;
       var requestId: String = result.getRequestId();
    * Asynchronous negative response.
    private function faultHandler(event: IOErrorActionEvent): void {
       client.removeEventListeners(); // shutdown all listeners!
       var result: AmazonWebServiceErrorResult = event.result as AmazonWebServiceErrorResult;
       var type: String = result.getType();
       var code: String = result.getCode();
       var message: String = result.getMessage();
       var detail: String = result.getDetail();  


    I agree that trace("....") should be removed.


    I'm interested to know for what purpose do you use this Flex library? In practice...


    Try unofficial correction from attach.

    Best Regards, Krešimir

  5. Kresimir Popovic repo owner

    Hello, I'm glad that you are satisfied with the correction.

    I will soon release official correction release 1.4.

    - All traces will be removed from library.

    - removeEventListeners() method will be added to SQS and CloudWatch interface

    - Wiki will be updated

    - new ASDOC will be generated

    - Adobe AIR SQS Administration tool will be updated to version 1.0.2 (will use SDK library 1.4)

    ps. I'm interested to know for what purpose do you use this Flex library? In practice...if it is not a secret :-)

    Best Regards,


  6. Log in to comment