Creating the Connector Plugin

About JMS Connector Plugins

JMS connector plugins serve as a way to deliver the JMS client libraries to ReadyAPI and support direct connections to JMS brokers. The plugins provide ReadyAPI with template values that can be used for a connection. The initial context class cannot be changed in the UI, but other values are provided as a template.

Requirements

  • You need Java libraries you use to connect to your JMS provider.

  • We recommend that you have a Java Development Kit (JDK) installed and configured.

Before Creating Plugin

During the plugin configuration, you will need to know the following values:

  • Initial Context Class name

  • Provider URL

  • Connection Factory JNDI name

To get these values, you need to configure the JMS provider first.

Create a JAR File

To create a plugin jar file:

  1. In File Explorer, create an empty folder. This folder will become the root folder of the plugin.

  2. In the created directory, create the lib subfolder.

  3. Copy the JMS client libraries in the .jar format to the lib folder.

    Important

    If the JMS client libraries depend on other libraries, copy the latter to the lib folder, as well.

    Here is where you can find the library files for some popular providers:

    Table 15. Library files of the most popular providers.

    Provider

    Action

    Files

    ActiveMQ

    Copy the file from the ActiveMQ installation folder.

    activemq-all-5.X.X.jar

    WebSphere MQ 8 and 9

    Copy the files from the <WebSphere MQ Installation>\java\lib folder.

    com.ibm.mq.allclient.jar

    fscontext.jar

    jms.jar

    providerutil.jar

    WebSphere MQ 7

    Copy the files from the <WebSphere MQ Installation>\java\lib folder.

    CL3Export.jar

    CL3Nonexport.jar

    com.ibm.mq.headers.jar

    com.ibm.mq.jar

    com.ibm.mq.jmqi.jar

    com.ibm.mq.pcf.jar

    com.ibm.mqjms.jar

    dhbcore.jar

    fscontext.jar

    jms.jar

    jndi.jar

    jta.jar

    ldap.jar

    providerutil.jar

    rmm.jar



  4. Download the jms-plugin.properties file and save it to the root folder of the plugin.

  5. You should have the following file structure:

    <Plugin root folder>
    |--lib
       |--<Provider’s jar files>
    |--jms-plugin.properties
    
  6. Open the file in any text editor and edit the default values. Comments in the file help you understand what the properties mean.

  7. Configure the properties that affect the way the plugin works with ReadyAPI and the way it will be represented in the ReadyAPI interface.

    Property

    Description

    plugin.name

    The name of the plugin that will be displayed in the Plugin Manager. Does not affect your tests.

    plugin.version

    The version of the plugin that will be displayed in the Plugin Manager. Does not affect your tests.

    plugin.description

    The description of the plugin that will be displayed in the Plugin Manager. Does not affect your tests.

    plugin.autodetect

    Commands ReadyAPI to search for plugin components that are used in Custom Plugins. If set to false, ReadyAPI will only load the JMS client libraries.

    Only set to true if you plan to add custom elements to the plugin.

    minimum.ready.version

    The minimum supported version of ReadyAPI. The plugin will not be loaded in unsupported versions.

    connector.label

    The label that is used to select the plugin in ReadyAPI interface.

  8. Configure the properties that affect the way the plugin works with a JMS provider. When you configure them, you might need to specify the values that you get when you configure the JMS provider.

    initial.context.class.name

    The Context.INITIAL_CONTEXT_FACTORY property that the plugin uses to connect to the JMS provider. You can usually find the context factory in the JMS provider documentation.

    Here are classes name for some popular JMS providers:

    provider.url.template

    ActiveMQ

    org.apache.activemq.jndi.ActiveMQInitialContextFactory

    WebSphere MQ

    Specify the value that you get from the Initial Context Factory property when you configure the WebSphere MQ installation.

    Oracle Weblogic

    weblogic.jndi.WLInitialContextFactory

    TIBCO EMS

    com.tibco.tibjms.naming.TibjmsInitialContextFactory

    The URL of the service that will be suggested by the plugin by default. The user can change it at any point.

    Here are example values for some popular JMS providers:

    ActiveMQ

    tcp://<hostname>:61616

    WebSphere MQ

    Specify the value that you get from the Provider URL property when you configure the WebSphere MQ installation.

    TIBCO EMS

    tibjmsnaming://<hostname>:7222

    connection.factory.name.template

    The suggested Java Connection Factory that is used to create a connection to the JMS broker.

    Here are example values for some popular JMS providers:

    ActiveMQ

    ConnectionFactory

    WebSphere MQ

    Specify the value that you specify for the Connection Factory when you configure the WebSphere MQ installation.

  9. Build the plugin. You can do it in two ways:

    • By using JDK

      If you have JDK, create a Java archive file (JAR), by using the jar utility:

      1. Open the command prompt shell

      2. Switch to the plugin root folder

      3. Run the following command:

        jar cvf my-jms-connector-plugin.jar *
        
    • By using a file archiver

      1. Create a ZIP archive with the jms-plugin.properties file and the lib folder.

        Important

        Do not archive the root folder itself. This would create a wrong structure and make the plugin invalid.

        You get an archive with the following content:

        my-jms-connector-plugin.zip
        |--lib
           |--<Provider’s jar files>
        |--jms-plugin.properties
        
      2. Change its extension to .jar.

After you have a final .jar file, you can install it as described in the Install From File topic.

See Also

Publication date: