kafka listener for meteor - meteor

I want to consume Kafka messages in Meteor.
Is there any package in meteor to do it? how should approach this? I searched and I could find npm for node.js which can listen to kafka messages but not sure how this can be used in meteor.
Thank you

Have a look at the meteorhacks:npm package, which will allow you to use npm packages in your meteor app. Here is a blog post explaining how to use it (though the package README should be sufficient)

kafka-node would be the package that you might want to try. It is important to note that this is a server-side only package. Therefore you need to make sure to only import it from modules under /server. You can, of course, trigger sending messages from the client as well, but for that, you will need to wrap the kafka functionality in purely server-side meteor methods. Shared code will not work.
If you see an error message in your browser console such as Error: Cannot find module './lib/BufferMaker' then it is because the kafka-node package is also imported on the client.

Related

How does one turn on diagnostic and/or progress logging with firebase-tools run as a node module?

I have not been able to find any reference for the options passed into the node module version of firebase-tools. How do one turn on diagnostic logging or progress output? The github README for firebase tools only says:
The Firebase CLI can also be used programmatically as a standard Node module. Each command is exposed as a function that takes an options object and returns a Promise.
and has only the example:
client.deploy({
project: 'myfirebase',
token: process.env.FIREBASE_TOKEN,
cwd: '/path/to/project/folder'
}).then(function() {...
It would be really nice to get complete docs. The source code wasn't much help.
There isn't a good way to see progress via the programmatic API for the Firebase CLI right now. Your best bet would be to instead use spawn or similar to run it as a process and simply capture the stdout.
We'd like to improve this in the future but there are no concrete plans of what it will look like yet.
To see the complete list of keys off of the client object, see commands/index.js
In terms of what options to pass in, that is definitely hard to figure out. This seems like a great chance to submit an issue requesting specific improvements to documentation, or take a shot at documenting it yourself and submit a PR.

Is there a manual way of telling Spiderable to consider the page “ready”?

In my most recent Meteor app I'm using methods to fetch data from the server for my templates rather than subscriptions, and (I think?) this confuses the Spiderable package which don't seem to understand when the consider the page ready to render. The fetching of the data are in some cases bound to the templates in their onCreated callback.
So my question is: is there some kind of manual way of telling the spiderable package that all methods/subs are done and all templates have finished loading?
(For routing I'm using the flow router if that's of any importance.)

Should I be worried about 3rd-party packages accessing my settings.json?

I just saw a package that, in order to run properly, asks you to put something in the public section of settings.json. That made me wonder if the rest of the information there (sometimes sensible, like AWS keys) is accessible as well.
So, should I be worried about this or does Meteor hides this information from packages?
Any package you install from any package manager including NPM, Ruby Gems, and the Meteor package server can run arbitrary code on your computer as your user, including using the fs module to read and write files, accessing the network to send and receive data, etc.
In fact, you place the same trust in the developer whenever you install an application from the internet - almost any application on your computer could read your settings.json file, for example Dropbox, Chrome, etc.
Therefore, there is no way to completely secure the settings.json file from package code. The only way to be sure that packages are safe is to use only community-approved packages or read the source code of the packages you are using.

Checking email with CasperJS or PhantomJS

I'm looking to use CasperJS/PhantomJS to automate the testing of a project that extensively uses email as part of its process but I keep running into issues when I need check the content of emails in an automated way.
These tools are very capable of crawling through the HTTP version of many email services, but maintaining tests to keep up with UI changes made to external services is not something I want to do.
Do CasperJS or PhantomJS have the ability to use IMAP or POP3 to retrieve mail, or is there a more common solution that is generally implemented?
You can use any nodejs module with Casper:
"Like PhantomJS, CasperJS allows using nodejs modules installed through npm."
So you just need to check the npm repo and test which lib suits you.
Hi using casperjs\Phantomjs you can navigate and automate however for mailing process you have to use nodejs nodemailer module.Try the following command after installing nodejs.
npm install nodemailer#0.7.1.
This installs the nodemailer package and post that you can install the mail clients like sendgrid sendmail or you can just use the nodemailer direct transport but that may cause some delay in mail delivery.
Kindly check the nodemailer scripts and run the script using:
node scriptname.js
PhantomJS (and by extension, Casper) is a web browser - it's not able to use POP or IMAP as far as I know. My first thought as to approach would be to use a separate system for test automation (at least, for those tests that require verifying emails), e.g. using Python, Ruby, or Node.js, invoke Casper via the command line within those tests, and then use a separate tool to check and verify the email.
You could also use a dev smtp server with a web interface like mailcatcher (ruby) or maildev (node).
They also have a rest api, which returns the email in a more stable way than to use the web interface.
I don't tested it, but will soon.

Recommended way to require Node.js modules in Meteor

I'm hacking my way through my first Meteor app, and I've opened a bit of a rabbit hole in trying to connect to S3. I've installed awssum using meteorite, but it appears that I need to install the Node.js module of the same name to actually work through the examples. I'll eventually deploy my app to Heroku, and I'd like to be able to package my dependencies with my code. Googling a bit I've found a number of ways to do this, and I'm wondering which is close to being the best practice:
install the package I need in /public (https://github.com/possibilities/meteor-node-modules) (seems risky)
hack the buildpack I'm using (https://github.com/oortcloud/heroku-buildpack-meteorite) to require the node packages I need
Deploy my project as a Node module itself, thereby allowing dependencies (https://github.com/matb33/heroku-meteor-npm)
bundle your project, untar it, and install in the created node_modules dir (Recommended way to use node.js modules with meteor)
Which route should I take?
We are closing in on a release that interoperates w/ NPM packages. See Avi's writeup on meteor-talk.
He also gave a tech talk at last month's Devshop previewing the work, using S3 as the example: http://youtu.be/kA-QB9rQCq8

Resources