receive_msg: Receive messages

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Receive one or more messages from an SQS queue.

Usage

1
2
3
4
5
6
receive_msg(queue, attributes = NULL, n = 1, timeout = NULL,
  wait = NULL, query = NULL, ...)

consume_msg(queue, receive_args = list(), delete_args = list())

delete_msg(queue, handle, query = NULL, ...)

Arguments

queue

A character string containing a queue URL, or the name of the queue.

attributes

Currently ignored.

n

The number of messages to retrieve (maximum 10).

timeout

A number of seconds to make the message invisible to subsequent receive_msg requests. This modifies the queue's default visibility timeout. See visibility to modify this value after receiving a message.

wait

A number of seconds to wait for messages before responding to the request.

query

A list specifying additional query arguments to be passed to the query argument of sqsHTTP.

...

Additional arguments passed to sqsHTTP.

receive_args

A named list of arguments, other than queue, to be passed to receive_msg.

delete_args

A named list of arguments, other than queue and handle, to be passed to delete_msg.

handle

A message handle, as returned by receive_msg.

Details

receive_msg simply receives message(s). consume_msg does the same and then deletes the message(s) from the queue. delete_message deletes one or more messages from an SQS queue. If a message is not deleted, it remains visible in the queue and will be returned by subsequent calls to receive_msg.

Value

A data.frame of messages.

Author(s)

Thomas J. Leeper

References

ReceiveMessage DeleteMessage DeleteMessageBatch

See Also

link{send_msg}

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
  # list current queues
  list_queues()
  
  # create a queue
  queue <- create_queue("ExampleQueue")
  get_queue_url("ExampleQueue")
  
  # send message to queue
  send_msg("ExampleQueue", "This is a test message")
  # receive a message
  (m <- receive_msg("ExampleQueue", timeout = 0))
  
  # delete a message from queue
  delete_msg("ExampleQueue", m$ReceiptHandle[1])
  
  # delete queue
  delete_queue("ExampleQueue")
  

## End(Not run)

aws.sqs documentation built on May 2, 2019, 5:08 a.m.