samedi 31 janvier 2015

AWSSQS trying to create queue and get messages

I am trying to connect to AWS SQS to create a new queue and also fetch messages I've placed on a another queue. This is the code I'm using:



AWSSQS *sqs=[[AWSSQS alloc] initWithConfiguration:configuration];

AWSSQSCreateQueueRequest *createQueue = [[AWSSQSCreateQueueRequest alloc] init];
[createQueue setQueueName:@"TEST_Q2_NEW_3"];

BFTask *answer = [sqs createQueue:createQueue];
NSLog(@"Status queue creation: %@ %@", answer.result, answer.error);

AWSSQSReceiveMessageRequest *receiveMessageRequest = [[AWSSQSReceiveMessageRequest alloc] init];
receiveMessageRequest.QueueUrl = @"http://ift.tt/1KgpkpC";

answer = [sqs receiveMessage:receiveMessageRequest];
NSLog(@"Status messages received %@ %@", answer.result, answer.error);


The queue TEST_Q2_NEW_3 is created but the log message is:


Status queue creation: (null) (null)


No messages are fetched but in the SQS Management Console some has the status Messages in Flight. However, the log message is:


Status messages received (null) (null)


What am I missing?





Aucun commentaire:

Enregistrer un commentaire