Config File
The cbq config file is where you define Queue Connections as well as Worker Pools. These Connections and Worker Pools can also be added, removed, or modified based on the current environment. When you want to change where your queued Jobs are sent or how they are worked, this is the file you will modify.
Definitions
Queue Connections
Also referred to as "Connection." A Queue Connection defines where Jobs are serialized and the default settings that apply.
configure
The configure
method is where the production Queue Connection and Worker Pools definitions are constructed.
newConnection
This command creates a new QueueConnectionDefinition
builder component. It requires a unique name that will define this Connection and that will be used when defining Worker Pools.
Arguments | Type | Required | Default | Description |
---|---|---|---|---|
name | string |
| The unique name for the new Queue Connection. |
A QueueConnectionDefinition
has various methods to configure the Queue Connection.
newWorkerPool
This command creates a new WorkerPoolDefinition
builder component. It requires a unique name
that will define this Worker Pool and a connectionName
that points to an already created Connection.
Arguments | Type | Required | Default | Description |
---|---|---|---|---|
name | string |
| The unique name for the new Worker Pool. | |
connectionName | string |
| A reference to an existing Connection. If not passed in here, the | |
quantity | numeric |
| 1 | The number of workers to spin up for this Worker Pool. |
queues | array |
|
| An array of queues that this Worker Pool will work. A queue of |
force | boolean |
|
| If |
A WorkerPoolDefinition
has various methods to configure the Worker Pool.
reset
Removes all Connections and Worker Pools
Environment Overrides
Just as in your config/ColdBox.cfc
file or in ModuleConfig.cfc
files, you can add, remove, or modify Queue Connection or Worker Pool definitions per environment. You do this by defining a method on your Config component matching the environment name you want to override.
withConnection
Retrieves an already defined Queue Connection Definition for overriding. All the same methods are available.
Queue Connectiondelete
This method is not yet implemented.
withWorkerPool
Retrieves an already defined Worker Pool Definition for overriding. All the same methods are available.
Worker Pooldelete
This method is not yet implemented.