Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add RabbitMQBoundQueueSensor #21

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

# 1.2.0
- Added `RabbitMQBoundQueueSensor` to support advanced routing options for queues

# 1.1.1
- Updated pip dependency to pika `1.3.x` to support python >= 3.7

Expand Down
74 changes: 74 additions & 0 deletions config.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,77 @@ sensor_config:
- "json"
- "pickle"
required: false
sensor_binding_config:
description: "RabbitMQ Sensor with advanced routing settings"
type: "object"
required: false
additionalProperties: false
properties:
host:
description: "RabbitMQ host to connect to"
type: "string"
required: true
username:
description: "Optional username for RabbitMQ"
type: "string"
password:
description: "Optional password for RabbitMQ"
type: "string"
secret: true
deserialization_method:
description: "Method used to de-serialize body. Default is to leave body as-is"
type: "string"
enum:
- "json"
- "pickle"
required: false
exchanges:
description: "A list of exchanges, with queues and routing rules"
type: "array"
required: true
items:
type: "object"
additionalProperties: false
properties:
name:
description: "Exchange name"
type: "string"
required: true
exchange_type:
description: "Exchange type"
type: "string"
enum:
- "direct"
- "fanout"
- "topic"
- "headers"
required: false
queues:
description: "A list of queues to monitor for this exchange"
type: "array"
required: true
items:
type: "object"
additionalProperties: false
properties:
name:
description: "Queue name"
type: "string"
required: true
bindings:
description: "A list of bindings for queue to have to this exchange"
type: "array"
required: false
items:
type: "object"
additionalProperties: false
properties:
routing_key:
description: "Optional Routing key to bind queue to exchange with"
type: "string"
required: false
arguments:
description: "Optional arguments to provide when binding queue to exhange"
type: "object"
required: false
additionalProperties: true
2 changes: 1 addition & 1 deletion pack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords:
- aqmp
- stomp
- message broker
version: 1.1.1
version: 1.2.0
python_versions:
- "3"
author: StackStorm, Inc.
Expand Down
39 changes: 39 additions & 0 deletions rabbitmq.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,42 @@ sensor_config:
queues:
- "queue1"
deserialization_method: "json"
sensor_binding_config:
host: "10.0.0.100"
username: "guest"
password: "guest"
exchanges:
- name: "my_direct_exchange"
queues:
- name: "images"
bindings:
- routing_key: "app.images"
- name: "movies"
bindings:
- routing_key: "app.movies"
- name: "my_fanout_exchange"
exchange_type: "fanout"
queues:
- name: "fanout_1"
- name: "fanout_2"
- name: "fanout_3"
- name: "my_topic_exchange"
exchange_type: "topic"
queues:
- name: "topic_a"
bindings:
- routing_key: "*"
arguments:
x-queue-type: "quorum"
- name: "topic_b"
bindings:
- routing_key: "a.b.c"
- name: "my_headers_exchange"
exchange_type: "headers"
queues:
- name: "headers_1"
bindings:
- arguments:
x-match: "any"
my_header: "val"
other_header: "other_val"
Loading