---
title: Using Go, Python or Node.js with Scaleway Queues
description: This page explains how to use Go, Python or Node.js with Scaleway Queues and provides code samples
tags: messaging boto3 python nodejs sqs go
dates:
  validation: 2025-11-19
  posted: 2023-01-04
---
import Requirements from '@macros/iam/requirements.mdx'


AWS provides a number of SDKs (**S**oftware **D**evelopment **K**its) which provide language-specific APIs for AWS services, including [SQS](/queues/concepts#sqs), which is the protocol Scaleway Queues is based on.

- AWS provides a dedicated [SDK for Go](https://aws.amazon.com/sdk-for-go/).
- The [AWS SDK for Python](https://aws.amazon.com/sdk-for-python/) is Boto3
- For Node.js, use the [AWS SDK for JavaScript](https://aws.amazon.com/sdk-for-javascript/), which can be [installed from NPM](https://github.com/aws/aws-sdk-js-v3#getting-started)

This guide provides code samples to show you how to start using these SDKs with Scaleway Queues.

<Requirements />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- Valid [credentials](/queues/how-to/create-credentials/) for Scaleway Queues
- Installed the relevant AWS SDK [for Go](https://aws.amazon.com/sdk-for-go/), [Python](https://aws.amazon.com/sdk-for-python/) and/or [JavaScript](https://aws.amazon.com/sdk-for-javascript/)

## Go

### Connect to Queues (Go)

The following code sample shows how to connect to Scaleway Queues:

```go
import (
  "github.com/aws/aws-sdk-go/aws"
  "github.com/aws/aws-sdk-go/aws/credentials"
  "github.com/aws/aws-sdk-go/aws/session"
  "github.com/aws/aws-sdk-go/service/sqs"
)

func main() {
  awsSession := session.Must(session.NewSession(&aws.Config{
    Region:   aws.String("fr-par"),
    Endpoint: aws.String("http://sqs.mnq.fr-par.scaleway.com"),
    Credentials: credentials.NewStaticCredentials(AwsAccessKey, AwsSecretKey, ""),
  }))

  awsSqs := sqs.New(awsSession)

  [...]
}
```

<Message type="note">

  The `Endpoint` for Scaleway Queues is `https://sqs.mnq.fr-par.scaleway.com`. For the access and secret key values, use the credentials you [generated](/queues/how-to/create-credentials/) for Queues.

</Message>

Once you are connected, you can use any functions available with the SDK. However, we recommend that you check they are [supported by Scaleway Queues](/queues/reference-content/queues-support/). See the [official documentation](https://pkg.go.dev/github.com/aws/aws-sdk-go/service/sqs) for more details on using the SDK, or read on to see some examples.

### Create queue (Go)

```go
createQueueResponse, _ := awsSqs.CreateQueue(&sqs.CreateQueueInput{
  QueueName: aws.String("my-test-queue"),
})
fmt.Println(*createQueueResponse.QueueUrl)
```

### Send messages to this queue (Go)

```go
for i := 0; i < 10; i++ {
  _, _ = awsSqs.SendMessage(&sqs.SendMessageInput{
    MessageBody: aws.String(fmt.Sprintf("Hello World: %d", i)),
    QueueUrl:    createQueueResponse.QueueUrl,
  })
}
```

### Receive messages from this queue (Go)

```go
for {
  receiveMessageResponse, err := awsSqs.ReceiveMessage(&sqs.ReceiveMessageInput{
    QueueUrl: createQueueResponse.QueueUrl,
  })
  if err != nil || len(receiveMessageResponse.Messages) == 0 {
    break
  }
  for _, m := range receiveMessageResponse.Messages {
    fmt.Println(*m.Body)
  }
}
```

## Python

### Connect to Queues (Python)

The following code sample shows how to connect to Scaleway Queues using Boto3's `resource()`. It is also possible to use `client()`, but `resource()` is more pythonesque:

```python
sqs = boto3.resource('sqs',
  endpoint_url=[],
  aws_access_key_id=[],
  aws_secret_access_key=[],
  region_name='fr-par')
```

<Message type="note">
  The `endpoint_url` for Scaleway Queues is `https://sqs.mnq.fr-par.scaleway.com`. For the access and secret key values, use the credentials you [generated](/queues/how-to/create-credentials/) for Queues.
</Message>

Once connected, you can use any functions available with the SDK - just check that they are [supported by Scaleway Queues](/queues/reference-content/queues-support/). See the [official documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html) for more details, or read on to see some examples.

### Create queue (Python)

```python
# Create the queue. This returns an SQS.Queue instance
queue = sqs.create_queue(QueueName='my test queue')

# You can now access identifiers and attributes
print(queue.url)
print(queue.attributes)
```

### Send messages to this queue (Python)

```python
for i in range (0,10):
  queue.send_message(MessageBody="Hello World: "+str(i))
```

### Receive messages from this queue (Python)

```python
for message in queue.receive_messages():
  print(message.body)
  message.delete()
```

## Node.js

### Connect to Scaleway Queues (NodeJS)

Here, we use the `@aws-sdk/client-sqs` module, which is the latest SDK available.
Import the required module:
```javascript
const { SQSClient, SendMessageCommand, CreateQueueCommand, ReceiveMessageCommand } = require("@aws-sdk/client-sqs");
// If you use ES6 syntax
// import  { SQSClient, SendMessageCommand, CreateQueueCommand, ReceiveMessageCommand } from "@aws-sdk/client-sqs"; 
```

The following code sample shows how to connect to Scaleway Queues:

```javascript
var sqsClient = new SQSClient({
  credentials: {
    accessKeyId: SQS_ACCESS_KEY_ID,
    secretAccessKey: SQS_ACCESS_KEY
  },
  region: "par",
  endpoint: SQS_ENDPOINT,
})
```

<Message type="note">
  The `endpoint_url` for Scaleway Queues is `https://sqs.mnq.fr-par.scaleway.com`. For the access and secret key values, use the credentials you [generated](/queues/how-to/create-credentials/) for Scaleway Queues.
</Message>

Once connected, you can use any of the SDK's functions as long as they are [supported by Scaleway Queues](/queues/reference-content/queues-support/). Refer to AWS's [official documentation](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SQS.html) for more information, or read on to see some examples.

### Create queue (NodeJS)

```javascript
const createQueueCommand = new CreateQueueCommand({
    QueueName: 'SQS_QUEUE_NAME',
    Attributes: {
      'MessageRetentionPeriod': '86400'
    }
  });
    
const createQueue = await sqsClient.send(createQueueCommand);
console.log(createQueue.QueueUrl);
```

You can find all available parameters for createQueue in the AWS documentation [here](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SQS.html#createQueue-property).

### Send messages to this queue (NodeJS)

The following code sample demonstrates how to send a message with some `MessageAttributes`:

```javascript
const sendMessageCommand = new SendMessageCommand({
  MessageAttributes: {
    "Name": {
      DataType: "String",
      StringValue: "John"
  }},
  MessageBody: "This is a test message to John",
  QueueUrl: "SQS_QUEUE_URL"
  });
  
const sendMessage = await sqsClient.send(sendMessageCommand)
console.log("Success", sendMessage.MessageId);
});
```

### Receive messages from this queue (NodeJS)

The following code sample shows how to read messages from a queue, and then delete them:

```javascript
var queueURL= "SQS_QUEUE_URL";

const receiveMessageCommand = new ReceiveMessageCommand({
  MaxNumberOfMessages: 10,
  QueueUrl: queueURL,
  VisibilityTimeout: 20
});

const receiveMessage = await sqsClient.send(receiveMessageCommand);
console.log(receiveMessage);
```
