> For the complete documentation index, see [llms.txt](https://cbq.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cbq.ortusbooks.com/4.0.0/configuration/config-file/queue-connection.md).

# Queue Connection

A Queue Connection is defined inside your cbq config file using a `QueueConnectionDefinition` builder component.  You can create one of these builder components using the [`newConnection`](/4.0.0/configuration/config-file.md#newconnection) method.

### QueueConnectionDefinition Methods

#### provider

Sets the provider for the Queue Connection.  This can be any valid WireBox mapping and should implement the `IQueueProvider` interface. (There is no need to use the `implements` keyword.)

<table><thead><tr><th>Arguments</th><th width="128">Type</th><th>Required</th><th>Default</th><th>Description</th><th data-hidden><select></select></th></tr></thead><tbody><tr><td>provider</td><td>string</td><td><code>true</code></td><td></td><td>A valid WireBox mapping to the desired Provider.</td><td></td></tr></tbody></table>

#### setProvider

Alias for [`provider`](#provider).

#### setProperties

Accepts a struct of properties to configure the Queue Connection.  The available properties are usually defined by the Queue Provider being used.

#### setDefaultQueue

Sets the default queue to use for jobs dispatched on this Queue Connection.

#### markAsDefault

Marks this Queue Connection as the default Queue Connection for jobs dispatched without specifying a Queue Connection.

#### setMakeDefault

Alias for [`markAsDefault`](#markasdefault).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cbq.ortusbooks.com/4.0.0/configuration/config-file/queue-connection.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
