SNS SQS

Information associated with messaging and queueing in AWS

To send a message to an SQS standard queue:

aws --profile=echofish sqs send-message --queue-url https://sqs.us-east-1.amazonaws.com/118234403147/rudy-standard-test-delete --message-body "{\"prefix\":\"rudy\",\"ship_name\":\"Henry_B._Bigelow\",\"cruise_name\":\"HB0707\",\"sensor_name\":\"EK60\",\"input_zarr_path\":\"level_1/Henry_B._Bigelow/HB0707/EK60/D20070712-T152416.zarr\",\"output_zarr_bucket\":\"noaa-wcsd-zarr-pds\",\"output_zarr_path\":\"level_2/Henry_B._Bigelow/HB0707/EK60/HB0707.zarr\"}"

The record that is passed can be read as:

{
	'Records': [{
		'messageId': '3f345823-1522-435f-9499-674f7e0a0bfb',
		'receiptHandle': 'AQEB6TAslc02HzXUAfAmrFI/VRxbvKT/M530AKc1gcufg7jM17/WtSpKRrjCRb9xlvyCN2JqX0qkeXU084bc043H5CmkfKclPocFzQE8Ogafug5n6fPQctVYwZeCLK15wZAHfypkjenw6Z5TntdT9MAGmjm0FlQdlOYE1lfQeHtRwX7t81cDeN0FUX3qP/hk9r5wfybJMiS+/6YOWnFoPZWUHXZ/dA9EjBeh/0v+IB9/Tu6ixHEyhnzmLxDkApJlQBehdPg/2GecbqZfQKZMhYnBI866qsBjKuM5e5/nXZMDnl6MqJNqezlF3CGD9C8QX80ZqE4LzGguI/HnDKCW7hiMq7slQ66RtC/26ddGS+NT+cayWDe9des9PLkjOhhm90Tn4D+C1jUAjirpoUCGJOVVoQ==',
		'body': '{"prefix":"rudy","ship_name":"Henry_B._Bigelow","cruise_name":"HB0707","sensor_name":"EK60","input_zarr_path":"level_1/Henry_B._Bigelow/HB0707/EK60/D20070712-T152416.zarr","output_zarr_bucket":"noaa-wcsd-zarr-pds","output_zarr_path":"level_2/Henry_B._Bigelow/HB0707/EK60/HB0707.zarr"}',
		'attributes': {
			'ApproximateReceiveCount': '1',
			'SentTimestamp': '1686088947048',
			'SenderId': 'AROARXB2R2FFW4HQHTMNN:klucik@colorado.edu',
			'ApproximateFirstReceiveTimestamp': '1686088947057'
		},
		'messageAttributes': {},
		'md5OfBody': '23e2b397daac325c294e68b7452f0ac2',
		'eventSource': 'aws:sqs',
		'eventSourceARN': 'arn:aws:sqs:us-east-1:118234403147:rudy-standard-test-delete',
		'awsRegion': 'us-east-1'
	}]
}

with a standard python "json.loads(event['Records'][0]['body'])."

Last updated

Was this helpful?