Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vernemq
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
stack
vernemq
Commits
412aa10d
Commit
412aa10d
authored
Nov 06, 2018
by
Chavee Issariyapat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add push handler
parent
7a00be97
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
2 deletions
+56
-2
pubhook/config/chavm.json
+6
-0
pubhook/on_publish.js
+18
-2
redis/k8s/deployment.yaml
+32
-0
No files found.
pubhook/config/chavm.json
0 → 100644
View file @
412aa10d
{
"rabbitmq_host"
:
"npn1.kube.nexpie.com"
,
"rabbitmq_port"
:
"31672"
,
"rabbitmq_username"
:
"b1ffb9e39865f3cb70cc2ef14920e023"
,
"rabbitmq_password"
:
"c3efbc0c4bdb1747a31cebac20d9b9b8"
}
pubhook/on_publish.js
View file @
412aa10d
...
...
@@ -31,11 +31,11 @@ module.exports = function(options={}) {
var
ptext
=
Buffer
.
from
(
data
.
payload
,
'base64'
).
toString
();
if
(
stopic
&&
ptext
)
{
let
msg
;
switch
(
a
[
0
])
{
case
'wf'
:
case
'writefeed'
:
var
msg
=
[{
msg
=
[{
"topic"
:
stopic
,
"payload"
:
ptext
,
"ts"
:
Date
.
now
(),
...
...
@@ -49,8 +49,24 @@ module.exports = function(options={}) {
throw
err
;
}
});
break
;
case
'push'
:
msg
=
[{
"topic"
:
stopic
,
"payload"
:
ptext
,
"ts"
:
Date
.
now
(),
"cid"
:
data
.
client_id
,
}];
client
.
act
(
'cmd:push'
,
{
message
:
JSON
.
stringify
(
msg
)
},
(
err
,
res
)
=>
{
if
(
err
)
{
throw
err
;
}
});
break
;
}
}
}
...
...
redis/k8s/deployment.yaml
0 → 100644
View file @
412aa10d
apiVersion
:
extensions/v1beta1
kind
:
Deployment
metadata
:
name
:
redis
namespace
:
nexpieio
labels
:
app
:
redis
tier
:
backend
spec
:
# this replicas value is default
# modify it according to your case
replicas
:
1
# selector can be applied automatically
# from the labels in the pod template if not set
selector
:
matchLabels
:
app
:
redis
tier
:
backend
template
:
metadata
:
labels
:
app
:
redis
tier
:
backend
spec
:
imagePullSecrets
:
-
name
:
docknexpie
containers
:
-
name
:
redis
image
:
dock.nexpie.com/stack/vernemq/redis:1.0.0-d640c8a
ports
:
-
containerPort
:
6379
name
:
redis
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment