Skip to content

Commit

Permalink
Add documentation for ActiveMQ Scaler (kedacore#611)
Browse files Browse the repository at this point in the history
Signed-off-by: melisatanrverdi <[email protected]>
Signed-off-by: Daniel Yavorovych <[email protected]>
  • Loading branch information
melisatanrverdi authored and daniel-yavorovich committed Jan 26, 2022
1 parent 6c99e8a commit e25ee65
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions content/docs/2.6/scalers/activemq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
+++
title = "ActiveMQ"
availability = "v2.6+"
maintainer = "Community"
description = "Scale applications based on ActiveMQ Queue."
layout = "scaler"
go_file = "activemq_scaler"
+++

### Trigger Specification

This specification describes the `activemq` trigger that scales based on a ActiveMQ Queue.

```yaml
triggers:
- type: activemq
metadata:
managementEndpoint: "activemq.activemq-test:8161"
destinationName: "testQueue"
brokerName: "activemq_broker"
targetQueueSize: "100"
```
**Parameter list:**
- `managementEndpoint` - ActiveMQ management endpoint in format: `<hostname>:<port>`.
- `destinationName` - Name of the queue to check for the message count.
- `brokerName` - Name of the broker as defined in ActiveMQ.
- `targetQueueSize` - Target value for queue length passed to the scaler. The scaler will cause the replicas to increase if the queue message count is greater than the target value per active replica. (Default: `10`, Optional)
- `restAPITemplate` - Template to build REST API url to get queue size. (Default: `"http://{{.ManagementEndpoint}}/api/jolokia/read/org.apache.activemq:type=Broker,brokerName={{.BrokerName}},destinationType=Queue,destinationName={{.DestinationName}}/QueueSize"`, Optional)

**Parameter Requirements:**

- In case of `restAPITemplate` parameter is not used, parameters resolving the REST API Template are all **required**: `managementEndpoint`, `destinationName`, `brokerName`.
- ActiveMQ Scaler polls the ActiveMQ REST API to monitor message count of target queue. Currently, the scaler supports basic authentication. `username` and `password` are **required**. See [Authentication Parameters](#authentication-parameters) below.

### Authentication Parameters

You can authenticate by using username and password via `TriggerAuthentication` configuration.

**Username and Password based Authentication:**

- `username` - Username for connect to the management endpoint of ActiveMQ.
- `password` - Password for connect to the management endpoint of ActiveMQ.

### Example

```yaml
apiVersion: v1
kind: Secret
metadata:
name: activemq-secret
type: Opaque
data:
activemq-password: ACTIVEMQ_PASSWORD
activemq-username: ACTIVEMQ_USERNAME
---
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: trigger-auth-activemq
spec:
secretTargetRef:
- parameter: username
name: activemq-secret
key: activemq-username
- parameter: password
name: activemq-secret
key: activemq-password
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: activemq-scaledobject
spec:
scaleTargetRef:
name: nginx-deployment
triggers:
- type: activemq
metadata:
managementEndpoint: "activemq.activemq-test:8161"
destinationName: "testQ"
brokerName: "localhost"
targetQueueSize: "50"
authenticationRef:
name: trigger-auth-activemq
```

0 comments on commit e25ee65

Please sign in to comment.