Skip to main content

Adobe

Visualize OSGi Service Graphs with Composum

Graph Hero

Here’s a neat trick for AEM developers and architects: you can create a diagram representation of the service dependencies using Composum. For those not familiar, Composum is an Open-Source project based on Apache Sling.
To create a service dependency diagram, you will need to install two additional dependencies:

Once you install the dependencies, you can access the Composum Service Graph web console at /system/console/servicegraph.
Screenshot of the Service Graph Web Console

Using the Service Graph Web Console

The Service Graph Web Console has a couple fields, the most important being the Classnames Regex. You can put any regular expression to filter what classes should be including:

  • ^com.composum
  • ^com.day.cq.wcm.foundation.forms

Every OSGi Service matching the regular expression will be included in the graph. Note that having too broad of a regular expression, such as ^com.adobe or ^org will cause the graph to fail to render, so make sure to narrow down as much as possible.

Downloading as an Image

Currently, the Service Graph is only available as an SVG, not a downloadable image, but using the following JavaScript snippet you can download the Service Graph:

I’ve also created an issue with the Composum team to include this in their next release.

Thoughts on “Visualize OSGi Service Graphs with Composum”

  1. Is there a specific version of AEM this works with? I tried it out on a vanilla 6.3.1 install and the Composum commons package won’t start – bunch of unresolved dependencies.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Dan Klco, Adobe Digital Marketing Technical Director

Dan is a certified Adobe Digital Marketing Technologist, Architect, and Advisor, having led multiple successful digital marketing programs on the Adobe Experience Cloud. He's passionate about solving complex problems and building innovative digital marketing solutions. Dan is a PMC Member of the Apache Sling project, frequent Adobe Beta participant and committer to ACS AEM Commons, allowing a unique insight into the cutting edge of the Adobe Experience Cloud platform.

More from this Author

Follow Us
TwitterLinkedinFacebookYoutubeInstagram