# Category Archives: NodeJs

## Auto start pm2 when reboot Windows

install pm2:

$npm install pm2 -g install mp2 start for windows$ npm install pm2-windows-startup -g

install pm2 window service

$npm i pm2-windows-service -g$ pm2-service-install [-n <service name>]

and go to this install path: C:\Users\Administrator\AppData\Roaming\npm\node_modules\pm2-windows-service\src\daemon\ and find file

is called “mp2node” and edit at <argument>[js file].js</argument> to path of your javascript file and save and reboot service in “Service.msc”

Posted by on September 7, 2017 in NodeJs, pm2

## ActiveMQ 4 Node.JS

By:  (Software Developer | Research Assistant , Seneca College, Toronto, ON)

1. What is ActiveMQ?
2. Can we integrate ActiveMQ with Node.JS ?
3. Implementation:

### Introduction?

#### Java Messaging Services.

• Used for sending messages from application to application
• Used for enterprise messaging which is referred to as MOM ( Message Oriented Middleware )
• Messages contain business data and are routed through networks using protocols. There are many vendors that have their own implementations which follow this standard. Such as IBM WebSphere MQ, ActiveMQ, etc.
• ActiveMQ is open source and a powerful messaging system used across the enterprise.

### Can We Integrate ActiveMQ With Node.JS ?

• It is possible to integrate it but you would have to write some code to do that.
• Luckily I just thought about starting this project after watching this TED talk by Tim Berners-Lee on openness of the web and access to data.
• I will be following and implementing open standards also the code will be open source.
• ActiveMQ has support for the following protocols: [‘TCP’,’UDP’,’WS’,’MQTT’,’STOMP’, ….]

### Implementation:

I will be working on this project at https://github.com/zmhassan/activemq-node.js and if anyone is interested feel free to join in on the fun programming.

As you can see I got build errors. I’m using a continuous integration system to test quality of the code and do it continuously. I believe in writing clean code.

I made a proposal to the Apache ActiveMQ community to replace the existing web console with a light-weight Node.JS web console.

This will allow the following to be possible:

• Web sockets
• Async
• Responsive
• Lightweight

Note: This will run standalone and communicate to ActiveMQ via the following protocols: stomp, tcp, mqtt, etc.

Here is a link to the email thread on discussions between me and the Apache ActiveMQ community:

http://activemq.2283324.n4.nabble.com/Node-JS-Client-Library-for-Accessing-Apache-ActiveMQ-td4677269.html#a4677293