grafana / k6-jslib-aws

Javascript Library allowing to interact with AWS resources from k6 scripts
Apache License 2.0
18 stars 28 forks source link

Add support for attributes and delay seconds for SQS #65

Closed nickcaballero closed 9 months ago

nickcaballero commented 9 months ago

Adds support for sending SQS attributes and setting the delay seconds.

viggu888 commented 9 months ago

Hi, I tried the below code on my local and getting this error while sending the message using that method with message attributes,

await sqs.sendMessage(testQueue, JSON.stringify({ value: '123' }), { messageAttributes: { 'my-attribute': { type: 'String', value: 'my-attribute-value' } } })

ERRO[0001] Uncaught (in promise) SQSServiceError: The type of message (user) attribute 'my-attribute' is invalid. You must use only the following supported type prefixes: Binary, Number, String. running at bound construct (native)

nickcaballero commented 9 months ago

Hi, I tried the below code on my local and getting this error while sending the message using that method with message attributes,

await sqs.sendMessage(testQueue, JSON.stringify({ value: '123' }), { messageAttributes: { 'my-attribute': { type: 'String', value: 'my-attribute-value' } } })

ERRO[0001] Uncaught (in promise) SQSServiceError: The type of message (user) attribute 'my-attribute' is invalid. You must use only the following supported type prefixes: Binary, Number, String. running at bound construct (native)

Ah yes, mixed up the value attribute with the DataType. Can you please try again?