#include <stdio.h>
#include <getopt.h>
#include <stdlib.h>
#include <string.h>
#include "aws4c.h"
Go to the source code of this file.
Functions | |
void | DumpResult (int rv, IOBuf *bf) |
This is an example that shows how to use SQS functions of AWS4C The example performs the following actions. | |
int | main (int argc, char *argv[]) |
void DumpResult | ( | int | rv, | |
IOBuf * | bf | |||
) |
This is an example that shows how to use SQS functions of AWS4C The example performs the following actions.
Initializes the library Creates the queue Obtains the full URL of the queue Gets get queue parameters Sets visibility timeout of the queue Puts a number of messages into the queue Reads a number of messages from the queue Delets the processed messages a helper function that prints out a result of the operation and data returned by the server
Definition at line 24 of file sqs_example.c.
References aws_iobuf_getline(), IOBuf::code, IOBuf::eTag, IOBuf::lastMod, IOBuf::len, and IOBuf::result.
Referenced by main().
int main | ( | int | argc, | |
char * | argv[] | |||
) |
Initialized the library
Create the Queue
Note failure to create the queue means either genuine error or simply the fact that the queue already exist for most applications it is okay to continue even if this operation fails
Get the URL of the queue Most applications require the full URL of the queue which might be different from the queue name passwd to the SQSCreate queue
Send a few messages
Now receive them back
Definition at line 44 of file sqs_example.c.
References aws_init(), aws_iobuf_free(), aws_iobuf_getline(), aws_iobuf_new(), aws_read_config(), aws_set_debug(), IOBuf::code, DumpResult(), sqs_create_queue(), sqs_delete_message(), sqs_get_message(), sqs_get_queueattributes(), sqs_list_queues(), sqs_send_message(), and sqs_set_queuevisibilitytimeout().
Generated by Doxygen