Contents

Creating and Configuring Custom MBean Service

Below sections illustrate how to create and register a custom MBean Service for the FioranoMQ Server.

Create Service

  1. Create an MBean Java Class and extend the fiorano.jms.jmx.ComponentMBean.
  2. Override life cycle methods including createService(), startService() and stopService() which are invoked by the Fiorano Server during server initialization.
  3. Write the code specific to the service in these methods. (Look at the sample 1.)
  4. Compile using compile-client.bat.
  5. Write an .xml file of the same name describing the MBean's attributes and save it in the same directory as the MBean class file. Create a jar file. (See Sample 4.)Update the fmq.conf with the location of this jar file (under the java.classpath heading).
  6. To install FioranoMQ as a Windows NT Service, update %FIORANO_HOME%/WinService/conf/fmq.conf with the location of this jar file.
Sample 1

Configure Service

  1. Create a directory in the %FIORANO_INSTALL_DIR%\fmq\profiles\FioranoMQ\deploy\services.
  2. For example- Create a directory PubSubTest in the location. Create a service descriptor file with the MBean Class name, the name and type of service and copy this file into the above directory.
  3. If this service is dependent on other services, use the dependent element in the Service Descriptor:

PubSubTestAdapterMBean0-service.xml:

4. If the service on which this is dependent is not known, configure this service to start after all other Server services have started. as stated in step 3

Sample 2

Deploy Service

    1. If the required dependencies have been specified in the service descriptor file then this file can be appended to any the FioranoMQ.lst file. (Note: The sorting order is defined by the dependency specified not by the location of the dependency in the file.)
    2. If required dependencies have not been specified start the service after all other Server services are started. Create a separate list file and add service entries to this file. Add this file to the end of the list file entries in the deploy.xml file.

 

Sample 3: Deploy.xml

Start the FioranoMQ server

Sample 4

Common Problems and Solutions

Common problems encountered while creating a custom MBean Service as well as their solutions are provided in the table below:

ProblemSolution
ClassNotFoundException. Unable to find the MBean service.Set thecustomservice jar in the CLASSPATH either by editing fmq.bat or editing the system CLASSPATH.
Service created was unable to register.Custom MBean must extend fiorano.jms.jmx.ComponentMBean.
Start this as the last service of the Server (since this service is dependent on other services).Add this service in a separate list file and append this file to the end of the list files in the deploy.xml. See Sample 3.
Custom codewrittenin the lifecycle methods (create, start, and stop) is not getting called.Write the custom code in the createService(), startService(), stopService() instead of in the create, start and stop methods.
Deployed the service in the service, but it is taking too long to perform a lookup for CF & Destinations.Set the property TransportProtocol to LPC for FioranoJNDIContext and execute the lookup. Without this change, the normal lookup is performed.
XML metadata not found for the classThe .xml file is not available at the correct location. Add the XML file in the same location as the class file. Create the jar again and copy it to the location mentioned in fmq.conf.
Adaptavist ThemeBuilder EngineAtlassian Confluence