Comments (4)
Sorry for the additional post, but i think i found one Bug which is related to subscriptions and using mongodb.
With the current implementation, i'm getting this error "tailable cursor requested on non capped collection ..." each time i want to subscribe to an device. I was able to fix this issue in the databse.js with creating the database collection directly with the "capped: true" property. Without this option it is not possible to use tailable cursors". I don't know if this is related to some changes in mongodb (tested version: 2.6.3). I will make a Pull-Request for this.
Unfortunately, i was not able to fix the issue with NeDB.
from meshblu.
Thanks for the heads-up. That bug is on our list (Basecamp #212).
Subscribe should work with MQTT and WebSocket protocols. We are planning to redirect HTTP and CoAP subscriptions to Redis rather than tailing Mongo. This may still be an issue for Raspberry Pis and other smaller devices that may not have enough processing power to run Redis.
from meshblu.
Ok, thanks for the info!
And for using subscriptions with Mongo, i think i've fixed that with adding the following to database.js:
if(config.mongo){
var mongojs = require('mongojs');
var db = mongojs(config.mongo.databaseUrl);
var devices = db.createCollection('devices' , {capped: true, size:10000,max:1000}, function() {
// do something here
console.log("Devices collection created");
});
var events = db.createCollection('events' , {capped: true, size:10000,max:1000}, function() {
// do something here
console.log("Events collection created");
});
var data = db.createCollection('data' , {capped: true, size:10000,max:1000}, function() {
// do something here
console.log("Data collection created");
});
module.exports = {
devices: db.collection('devices'),
events: db.collection('events'),
data: db.collection('data')
};
}
For now, it is working fine for me (WebSocket subscriptions tested).
from meshblu.
Cool. You should only need to cap the events collection.
from meshblu.
Related Issues (20)
- Help!!! Can not get message when i run meshblu on ubuntu14.04 x64 HOT 2
- Send/Receive messages HOT 5
- Cross-protocol send/Receive messages
- About unifying APIs for all protocols HOT 2
- Retaining messages HOT 1
- TypeError: callback is not a function HOT 2
- config.token or environment variable TOKEN is required. Exiting. HOT 1
- Forwarder of webhook
- Provide a way to run core-dispatcher & protocol adapters
- DispatcherWorker constructor is missing "@pepper on Ubuntu
- DispatcherWorker constructor is missing "@pepper
- meshblu.createConnection is not a function HOT 1
- Issues about "update" API in WebSocket / HTTP protocol with Meshblu 4.0.1 HOT 1
- Issues about "broadcast message" in WebSocket with Meshblu 4.0.1
- Issues about "subscribe" API in WebSocket with Meshblu 4.0.1 HOT 1
- Add optional support for Socket.io and Websockets
- Cannot receive message using "message.received" subscription
- Can get Devices use regex? HOT 1
- How to improve the amount of concurrency per second about Meshblu
- localhost 拒绝了我们的连接请求
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meshblu.