Start notification:
** You've set up some data subscriptions with Meteor.publish()
How to disable?
I'm going to assume you're getting this whole error message:
** You've set up some data subscriptions with Meteor.publish(), but
** you still have autopublish turned on. Because autopublish is still
** on, your Meteor.publish() calls won't have much effect. All data
** will still be sent to all clients.
**
** Turn off autopublish by removing the autopublish package:
**
** $ meteor remove autopublish
**
** .. and make sure you have Meteor.publish() and Meteor.subscribe() calls
** for each collection that you want clients to see.
To make the notification go away, just do what it asks you to do and run:
meteor remove autopublish
What is autopublish?
Autopublish is a package used for rapid prototyping. It sends all collections from MongoDB to the client for easy use. From the docs:
Publish all server collections to the client. This package is useful for prototyping an app without worrying about which clients have access to certain data, but should be removed as soon as the app needs to restrict which data is seen by the client.
Before putting your app on the internet you will want to turn this off and use publications and subscriptions to secure, filter and mange your data flow
Related
I am working in a Shiny app that connects to Comscore using their API. Any attempt at executing POST commands inside future/promises fails with the cryptic error:
Warning: Error in curl::curl_fetch_memory: Bulk data encryption algorithm failed in selected cipher suite.
This happens with any POST attempt, not only when/if I try to call ComscoreĀ“s servers. As an example of a simple, harmless and uncomplicated POST request that fails, here is one:
rubbish <- future(POST('https://appsilon.com/an-example-of-how-to-use-the-new-r-promises-package/'))
print(value(rubbish))
But everything works fine if I don not use futures/promises.
The problem I want to solve is that currently we have an app that works fine in a single user environment, but it must be upgraded for a multiuser scenario to be served by a dedicated Shiny Server machine. The app makes several such calls in a row (from a few dozen to some hundreds), taking from 5 to 15 minutes.
The code is running inside an observeEvent block, triggered by a button clicked by the user when he has configured the request to be submitted.
My actual code is longer, and there are other lines both before and after the POST command in order to prepare the request and then process the received answer.
I have verified that all lines before the POST command get executed, so the problem seems to be there, in the attempt to do a POST connecting to the outside world from inside a promise.
I am using RStudio Server 1.1.453 along with R 3.5.0 in a RHEL server.
Package versions are
shiny: 1.1.0
httr: 1.3.1
future; 1.9.0
promise: 1.0.1
Thanks in advance,
In my Meteor 1.0 app, I'm trying to connect the server to an external websocket (socket-io) API provided by a company called BTC China. Details on the API can be found here.
All the examples I have found are for the client. How does one subscribe to a socket-io API on the Meteor server? There doesn't seem to be a meteor package for this on atmospherejs.com and I'm struggling a bit. I've installed the socket-io NPM package and gotten this far:
var socket = Npm.require('socket.io').listen('https://websocket.btcchina.com/');
socket.emit('subscribe', ['marketdata_cnybtc']);
socket.emit('subscribe', ['marketdata_cnyltc']);
socket.emit('subscribe', ['marketdata_btcltc']);
socket.on('connect', function(){
console.log("Hello,btcc!");
socket.on('trade', function (data) {
console.log("Hello,trade!");
console.log(data);});
});
But this returns the following error: TypeError: Object https://websocket.btcchina.com/ has no method 'listeners', which means I'm defining the socket variable incorrectly. How can I fix this? Thanks!
I created a new Meteor package joncursi:socket-io-client to solve this problem. Please see https://atmospherejs.com/joncursi/socket-io-client for more detail and example usage. Since I've bundled the NPM binaries into a package, so you won't have to worry about installing NPM packages, declaring NPM.require() dependencies, etc. And best of all, you can deploy to .meteor.com without a hitch.
We have an SSIS package that is run via a SQLAgent job. We are initiating the job (via sp_startjob) from within an ASP.NET web page. The user that is logged onto the UI needs to be logged with the SSIS package that the user initiates - hence we require the userId to be passed to the SSIS package. The issue is we cannot pass parameters to sp_startjob.
Does anyone know how this can be achieved and/or know of an alternative to the above approach
It cannot be done through sp_startjob. You can't pass a parameter to a job step so that option is out.
If you have no concern about concurrency, and given that you can't have the same job running at the same time, you could probably hack it by changing your job step from type SQL Server Integration Services to something like a OS Command. Have the OS Command called a batch script that the web page creates/modifies. Net result being you start your package like dtexec.exe /file MyPackage /Set \Package.Variables[User::DomainUser].Properties[Value];\"Domain\MyUser\" At this point, the variable DomainUser in your package would have the value of Domain\MyUser.
I don't know your requirements so perhaps you can just call into the .NET framework and start your package from the web page. Although you'd probably want to make sure that call asynchronously. Otherwise unless your SSIS package is very fast, the users might try and navigate away, spam refresh etc waiting for it to the page to "work".
All of this by the way is simply pushing a value into an SSIS package. In this case, a user name. It doesn't pass along their credentials so calls to things like SYSTEM_USER would report the SQL Agent user account (or the operator of the job step).
We have a problem with our meteor server. When we publish 300 or so items with Meteor.publish/Meteor.subscribe the server increases its memory and eventually becomes unresponsive.
We thought of:
1) monitor the number of reactive subscribtions / memory taken by an active subscription
2) make something like ,,one time publish" - ignore changes in server side collection
Any thoughts on how any of the above can be accomplished ?
Or any other tips to debug /improve meteor app performance ?
Thanks
zorlak's answer is good.
Some other things:
You can do a one-time publish by writing your own custom publisher via the this.set API, based on the code in _publishCursor. You'd do something like:
Meteor.publish("oneTimeQuery", function () {
MyCollection.find().forEach(function (doc) {
sub.added("collectionName", doc._id, doc);
});
sub.ready();
});
This does a query, sends its results down, and then never updates it again.
That said, we hope that Meteor's performance will be such that this is unnecessary!
I'd also like to add an easy way to get stats (like number of observed cursors) from an app to Meteor (exposed as an authenticated subscription) but haven't had the time yet.
As of Meteor 0.5.1, one thing you can do is to remove dependencies on the userId from the publish function. If a publish function does not depend on which user is subscribing, then Meteor will cache the db query so it doesn't get slower as more users subscribe.
See this Meteor blog post: http://meteor.com/blog/2012/11/20/meteor-051-database-scaling
I modified the leaderboard example to use two collections:
Players = new Meteor.Collection("players");
Tasks = new Meteor.Collection("tasks");
The Players collection has the 6 documents defined in the example.
> db.players.count()
6
The Tasks collection has 48,000 documents.
> db.tasks.count()
48000
As soon as I open the browser, Node jumps to 100% CPU and the client can't see any of the tasks records.
Players.find().count()
6
Tasks.find().count()
0
I tried defining query criteria but that only works on the server and doesn't help on the client.
Players.find({name:"Claude Shannon"}).count();
1
Tasks.find({tid:"t36254"}).count();
0
I'm guessing that 48,000 documents is too much to sync. That's causing Node to peg at 100% CPU and the client to throw errors like this: http://i.imgur.com/zPcHO.png.
How do I prevent syncing everything and only retrieve specific documents from the collection?
The autopublish of Meteor, which publishes all of your collections to the client, is very impressive and makes things work fast, but it's kind of like Rails scaffolding functionality - not very useful for real apps - it's for learning and prototyping.
By default, Meteor automatically publishes every document in your collection to each connected client. To turn this behavior off, remove the package:
$ meteor remove autopublish
Then, learn to use the manual publish and subscribe functions, which offers you the control you need: http://docs.meteor.com/#publishandsubscribe