Sunday, February 21, 2016

RabbitMQ : Most Useful Commands

brew install rabbitmq

Admin: rabbitmq-plugins enable rabbitmq_management
------------------------------------------------------------------------
Start rabbitmq server
rabbitmq-server

Start rabbitmq application
rabbitmqctl start_app

Delete an existing user
rabbitmqctl delete_user vhostusersampleservice

Delete a virtual host  
rabbitmqctl delete_vhost vhostsampleservice

Add a virtual host  
rabbitmqctl add_vhost vhostsampleservice

Add a user
rabbitmqctl add_user vhostuser vhostpassword

Assign tags
rabbitmqctl  set_user_tags vhostuser administrator

Giving permissions:
 For all hosts /
rabbitmqctl set_permissions -p / vhostuser ".*" ".*" ".*”

For host /vhostsampleservice
rabbitmqctl set_permissions -p /vhostsampleservice vhostuser ".*" ".*" ".*”

Enable Management plugin:
For managing nodes and cluseters
rabbitmq-plugins enable rabbitmq_management
-->http://localhost:15672/#/

Mobile appliction using PhoneGap

We have talked a lot about mobile development, here this article will walk us through the basics of Corodova formarly known as PhoneGap.

Originally developed by Adobe, is a development framework that works for all mobile OS. It’s an open source framework, once the code is written with this , can run on any Os like iOS, android,blackberry and windows mobile.
Phonegap is powered by the Corodova engine.

The good part here is the program just need to know the basic of web application development and don’t require mobile specific programming. PhoneGap works like a bridge between the web application api and mobile OS.Essentially it provides a wrapper over the native api.
Corodova can be considered as an application container with a web view, used by the native OS. For eg  iOS usage objective c wevview ui class, android web view on android.

How to install phonegap
sudo npm install -g cordova
cordova create sampleapp
cordova platforms add android
cordova platforms add ios

sampleapp/
 |-- hooks/
 |-- platforms/
 |-- plugins/
 |-- www/
 -- config.xml
Please note that in case of android, android sdk should be available on your OS , and for iOS ,Xcode requires to be installed in your mac.

Corodova comes with the basic plugin, like camera, GPS, file system. It does provide creating a plugin for anything specific we want which is not available with the cordova.

Build: Corodova build the application and package the deployable as per the OS. For eg. Android os will have in apk format, iOS will produce IPA file, XAP file for  windows  phone.

Advantages of using cordova
-Very fast to use it, least pre requisite of learning
-Quick to prototype
-Managing images for multiple devices easier with using css and media queries.

Disadvantages:
-Not supported on all mobile browsers
-Not fit very well with varying  hardware sizes , screen size
-Integrate with third party api for eg google map is not stable, gives sometimes error
-For large application , it’s not easy to maintain it.