Created

Nov 12, 2012

How to sanity check OSGi bundles across environments

Posted by Sham HC

I would like to thank all for feedback and encouraging words on my earlier article "Unit Testing Email Notification" [0] & like to share another custom tool called OSGi Diff. This tool help to address some of frequent question I hear from the most customers like

  1. How to verify the system (OSGi bundles) is in order across various environments (DEV, QA, Pre-prod, DR, PROD ...)
  2. Some functionality no longer work in another environment, 
  3. How to ensure after upgrade all my bundles are updated.
  4. How to ensure service pack is installed correctly.
  5. Some times restoring the instance is not functional. etc...

On debugging found one of cause is difference in bundle missing or versions. This tool helps to show the difference by following three simple steps. In the results if you find any mismatch you will know the cause & take appropriate steps. Hope you might find this tool handy.

Introduction

OSGi is a fundamental element in the technology stack of CQ5. The Felix Framework is an implementation of the OSGi  core framework specification, provides an interface to retrieve information on the bundles (or bundle) available in the framework. OSGi Diff tool is a simple custom Cross-platform online application developed using java script which utilize the felix bundles information to compare against environments to show the conflicts & similarities.
  • With 3 simple steps makes it easier than ever for you to compare sanity check across environments the OSGi bundles that do what you intend, without any guesswork. The results shows you uniqueness, difference, addition, deletion and similarities in bundles.  This makes verification practical and safe.
  • Global presence 24/7 to check online OR Save the html source file for Offline usage.
  • There are two flavors of tool.
    • One is Standard version:-  To compare against any of your two environments.
    • Another is OOB (Out of the box) version:-  To compare against CQ Default bundles. (This will help to verify when you upgrade OR install service pack)

Advantages

  • Gives the IT team a means to verify the system (OSGI) is in order across environments.
  • The reports help IT team like support to diagnose issues & take quicker action to install the conflict bundles.
  • Provide means for implementation team to assert their setup should work
  • During package Installation you can be sure to verify the required OSGi bundle are installed.

Installation

  • Online Type:- Bookmark the below urls and check in your favorite browser. No need to install. 
    • Standard version:- [1]
    • OOB version:- [2] 
  • Offline Type:- If you do not have internet connection and want to use the tool offline. Save the html source file [1] & [2] for Offline usage OR download the attached zip and extract to your convenient folder.  The disadvantage with this when ever new service pack is installed. You might not get the OOB version updated. 

My plan is when ever new service pack is released I will update the online OOB version to include the new service pack bundles details. So using online version always have the latest service pack bundle information.

How to use the tool

The three simple steps to use is

Standard version:-

  • Paste complete JSON from two of environments you want to compare in each of the text fields at [1].  Example with standard cq installation without different context root the url would be http://<host>:<port>/system/console/bundles/.json
  • Click Compare
  • All the results of uniqueness, similarities in bundles are displayed with various colors & an option to filter.

OOB version:- 

Same as Standard version with an difference you select against default cq instance and service pack version. So you copy JSON from one environment. The steps are
  • Paste complete JSON from one of environments you want to compare against CQ default bundles in the text fields at [2].  Example with standard cq installation without different context route the url for json would be http://<host>:<port>/system/console/bundles/.json
  • Click Compare
  • All the results of uniqueness, similarities in bundles are displayed with various colors & an option to filter.

NOTE:-   I have checked both version of tools against popular browsers like IE, Firefox, Safari, Chrome but not with all versions of browser. It might not work in all browser version. 

Sample usecase for the tool

Few scenarios it can be helpful are
  • During code movement to ensure it matches against the lower environment.Ex:- QA against production after code deployment. 
  • When you find a scenario the functionality is behaving different in other environments.
  • After service pack Installation.
  • When you restore the instance from backup.

Download

HTML Source code Click Here .  

[0]    http://experiencedelivers.adobe.com/cemblog/en/experiencedelivers/2012/07/unit_testing_theemailnotification.html

[1]    http://dev.day.com/content/dam/day/onlinetool/CTI.html

[2]    http://dev.day.com/content/dam/day/onlinetool/COI.html

Abbreviation

  • OOB  :-  Out of the box
  • OSGi :-  Open Services Gateway initiative
  • JSON :-  JavaScript Object Notation

Reference

  • http://felix.apache.org/
  • http://stackoverflow.com/questions/3394770/how-to-store-key-value-pair-in-two-dimensional-array-and-hashtable-using-jquer
  • http://tlrobinson.net/projects/javascript-fun/jsondiff
  • http://www.vonloesch.de/node/23?filt=online

 

Note:- Information provided in this blog is for test purpose only and express my personal view.

COMMENTS

  • By jual propolis murah - 4:27 AM on Apr 01, 2013   Reply
    informative post, its so useful, keep it up
  • By manfaat madu - 4:27 AM on Apr 01, 2013   Reply
    wow, i dont know that, this is a great share, thank you
  • By belly bands for dogs - 4:29 AM on Apr 01, 2013   Reply
    nice share, it open my mind even more now, thanks
  • By wooden dog crates - 4:29 AM on Apr 01, 2013   Reply
    i dont know at first that it will be a useful information, but really, thank you for posting it
  • By bee propolis hd - 4:30 AM on Apr 01, 2013   Reply
    This information really helped me understand Things beyond my expertise. websites like this expanding knowledge everyone and I hope something like this will continue to grow
  • By dien dan seo - 5:10 AM on Apr 15, 2013   Reply
    Things beyond my expertise. websites like this expanding knowledge everyone and I hope something like this will continue to grow
  • By cộng đồng lập trình - 3:58 PM on Apr 17, 2013   Reply
    this expanding knowledge everyone and I hope something like this will continue to grow
  • By hdi bee propolis - 8:27 AM on Apr 20, 2013   Reply
    awesome information man, thx
  • By manfaat madu asli - 8:58 AM on Apr 21, 2013   Reply
    what a great post, thx for the share
  • By photo booth nj - 5:02 PM on Apr 27, 2013   Reply
    Thanks for keeping us informed
  • By wedding photography nj - 9:44 PM on Apr 27, 2013   Reply
    Its great to see you taking the time to share this information
  • By Stanley F. - 8:24 PM on May 02, 2013   Reply
    I have many different environments and it has been taking for ever to check all of the OSGi bundles. This was a big help.
  • By Cây nước nóng lạnh - 5:22 AM on May 04, 2013   Reply
    Wow...nice share, it open my mind even more now, thanks
  • By Chambres d'hotes cassis - 5:19 AM on May 14, 2013   Reply
    Appearing through this post reminds me of my previous roommate! I have actually reviewed this blog post and if I might I prefer to propose you few intriguing things or pointers. I desired to I enjoy your precious time and efforts using this excellent read !! I absolutely delighting in each and also every small spot of it as well as I've you bookmarked to check out new things you blog post. I simply bumbled after your weblog and wished to claim that I have actually truly loved searching around your blog post articles. I wanted to several thanks for the initiative for this terrific read !! I undoubtedly appreciating each little bit of part of this and also I've you bookmarked to enjoy an appeal at fresh stuff you blog article. And check this: <a href="http://www.financeutile.com">financement participatif</a> and <a href="http://www.mathsmalin.fr">maths en ligne</a>.