Add message queue trigger support (#218)

Adds support for message queue triggers based on the NATS-Streaming message queue.

This lets the user map a queue topic to a function, and optionally send the function's response into another queue topic.

The message queue trigger manager is designed to be message queue independent, so we should be able add support for more queues by adding implementations for the relatively simple mqtrigger.MessageQueue interface.
This commit is contained in:
Ta-Ching Chen
2017-07-05 17:19:58 -07:00
committed by Soam Vasani
parent 0fd60eab3b
commit e4fe007838
24 changed files with 1417 additions and 10 deletions
+60
View File
@@ -0,0 +1,60 @@
# To enable nats authentication, please follow the instruction described in
# http://nats.io/documentation/server/gnatsd-authentication/.
# And dont forget to change the MESSAGE_QUEUE_URL in mqtrigger deployment.
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: mqtrigger
namespace: fission
spec:
replicas: 1
template:
metadata:
labels:
svc: mqtrigger
spec:
containers:
- name: mqtrigger
image: fission/fission-bundle
command: ["/fission-bundle"]
args: ["--mqt"]
env:
- name: MESSAGE_QUEUE_TYPE
value: nats-streaming
- name: MESSAGE_QUEUE_URL
value: nats://nats-streaming:4222
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
svc: nats-streaming
name: nats-streaming
namespace: fission
spec:
replicas: 1
selector:
matchLabels:
svc: nats-streaming
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
svc: nats-streaming
spec:
containers:
- name: nats-streaming
image: nats-streaming
args: ["--cluster_id", "fissionMQTrigger"]
ports:
- containerPort: 4222
hostPort: 4222
protocol: TCP