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

Forwarder of webhook #134

Open
KimALam opened this issue Jun 8, 2016 · 0 comments
Open

Forwarder of webhook #134

KimALam opened this issue Jun 8, 2016 · 0 comments

Comments

@KimALam
Copy link

KimALam commented Jun 8, 2016

Hi~
Recently, I got a necessity of data forwarder.
So, to know how to use it and verify it works properly,
I used https://github.com/octoblu/data-forwarder-mongodb

But I recognized it does not work corretly.
So, digged into meshblu, and found some clues and fixed those.
However, I'm not a meshblu developer, so I am not sure it's fine.
My fixing is below to run https://github.com/octoblu/data-forwarder-mongodb

1) lib/SubscriptionGetter.coffee

8, 9 line has function name of "broadcast" and "config", but does not have about "received".
So, I appended received: 'canReceive' to SECURITY_MAP

@SECURITY_MAP:
broadcast: 'canReceive'
config: 'canDiscover'
received: 'canReceive'

2) src/publish-forwarder.coffee

structure of meshblu.forwarder is

"meshblu": {
"version": "2.0.0",
"forwarders": {
"message": {
"received": [...]
},
"broadcast": {
"received": [...]
}
},

so I fix the code
forwarders = attributes.meshblu?.forwarders?[type] || []
to
forwarders = attributes.meshblu?.forwarders?.message?[type] || []

3) src/controllers/device-controller.coffee in https://github.com/octoblu/data-forwarder-mongodb

fix
messageReceived = {subscriberUuid: uuid, emitterUuid: uuid, type: 'message.received'}
broadcastReceived = {subscriberUuid: uuid, emitterUuid: uuid, type: 'broadcast.received'}
to
messageReceived = {subscriberUuid: uuid, emitterUuid: uuid, type: 'received'}
broadcastReceived = {subscriberUuid: uuid, emitterUuid: uuid, type: 'broadcast'}

4) example.sh in https://github.com/octoblu/data-forwarder-mongodb

fix the type of message.received to received

meshblu-util subscription-create -s $FORWARDER_DEVICE_UUID -e $RECEIVER_DEVICE_UUID -t received ./tmp/data-forwarder-meshblu.json

I just tested it and had proper work.
Could you scrutinize that it is suitable?
Thanks in advance.

p.s) If you want, I can give diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant