- A JMX type Subscription can be added to a resource through UI just like any other Subscription. To learn how to add Subscriptions to a resources please refer Managing Subscriptions and Notifications.
Likewise any other subscription it is also possible to write an external client to add JMX subscriptions to a resource. Since we have not provide any API methods to perform Subscription related operations it is necessary to use one of the Admin Services of Registry to do the relevant. In the given below example we have used
InfoAdminServiceto add a subscription to a resource.
- To write and run this client it is necessary to have
AuthenticationAdminStubin the classpath of the project.
AuthenticationAdminStubwould get added to the classpath when user run ant inside
$GREG_HOME/binand point classpath of the project to
$GREG_HOME/repository/lib.But the user have to separately add I
nfoAdminServiceStubto classpath from
- In this sample we have only added a JMX type subscription to a resource. Similarly it is possible to use the stub class to
getSubscriptions()from a resource as well.
- When adding subscriptions it is necessary to pass the following parameters
- path of the resource to where the subscription should get added to.
- subscription endpoint as
jmx://to make the subscription JMX.
- event typeof subscription as user preferred. E.g. - ResourceUpdated.
- session Cookie.
- According to the given above sample now a subscription is added to the resource at
/_system/governance/clientResource.When the resource is accessed from the UI the added subscription would be visible to the user. And when ever the resource get updated the user would be able to view corresponding event through JMX Console. Refer Using JConsole to Monitor and Manage Governance Registry