This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

You can configure any type of JMS event adapter to run with WSO2 products. This guide discusses how to configure a few common types. You can receive XML, Map, JSON and Text events using JMS transport.

ActiveMQ Input JMS event adapter

Follow the instructions below to configure ActiveMQ Input JMS event adapter.

  1. Install Apache ActiveMQ JMS event adapter. 

    This guide uses ActiveMQ versions 5.7.0 or below. If you want to use a later version, for instructions on the necessary changes to the configuration steps, go to Apache ActiveMQ Documentation.

  2. Add the following ActiveMQ JMS-specific JAR files to  <PRODUCT_HOME>/repository/components/lib/ directory.
    • <ACTIVEMQ_HOME>/ lib/activemq-core-xxx.jar  
    • <ACTIVEMQ_HOME>/ lib/geronimo-j2ee-management_1.1_spec-1.0.1.jar  
  3. Start ActiveMQ and then start the product.

    You can configure this adaptor through the management console as explained below or by manually adding an XML file as explained in step 8.

  4. Log in to the CEP management console, go to Configure -->  Event Processor Configs --> Input Event Adaptors and click Add Input Event Adaptor. Then select 'jms' as the Event Adaptor Type. 
  5. Enter details in the form that appears and click Add Event Adaptor button at the end of the form. For example,

    Following values are used in the configuration above:

    Event Adaptor Name                  : activemqJmsInputAdaptor
    Event Adaptor Type                  : jms
    JNDI Initial Context Factory Class  : org.apache.activemq.jndi.ActiveMQInitialContextFactory
    URL of the JNDI provider            : tcp://localhost:61616
    Connection Factory JNDI Name        : TopicConnectionFactory
    Destination Type                    : topic
    Enable Durable Subscription         : false
    
  6. After a adapter is successfully added, you can change its configuration and redeploy it. To do this, click the Edit link associated with it. You can also click the other links associated with it to delete it or enable statistics and tracing.
  7. An XML based editor opens allowing you to edit the event adaptor configuration from UI itself, without having to edit the file in the file system.   Do your modifications and click Update.
  8. Alternatively, you can specify a event adaptor configuration using an XML file and save it in <PRODUCT_HOME>/repository/deployment/server/inputeventadaptors directory, which is the Input event adaptor deployment directory. Since hot deployment is enabled, you can simply add/remove files to deploy/undeploy from the server.

    Create the XML file with the following WSO2Event event adaptor configurations. Input event adaptor implementation must start with <inputEventAdaptor> root element.

    <inputEventAdaptor name="activemqJmsInputAdaptor" statistics="disable"
      trace="disable" type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
      <property name="java.naming.provider.url">tcp://localhost:61616</property>
      <property name="transport.jms.SubscriptionDurable">false</property>
      <property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
      <property name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</property>
      <property name="transport.jms.DestinationType">topic</property>
    </inputEventAdaptor>

    JMS event adaptor can be configured with XML , Map, Json and Text input mapping.

Qpid Input JMS Event Adaptor

Follow the instructions below to configure JMS-Qpid Input Event Adaptor.

  1. Install JMS-Qpid Broker and JMS-Qpid Client from http://qpid.apache.org.

  2. Before starting the CEP, add the following  broker-specific jars to <CEP_HOME>/repository/components/lib directory.
    • < ACTIVEMQ_HOME>/ lib/geronimo-jms_1.1_spec-1.0.jar  
    • <QPID-CLIENT_HOME>/ lib/ qpid-client-xxx.jar
    • <QPID-CLIENT_HOME>/ lib/ qpid-common-xxx.jar   

      You can configure this adaptor through the management console as explained below or by manually adding an XML file as explained in step 7.  
  3. Log in to the CEP management console, go to Configure -->  Event Processor Configs --> Input Event Adaptors and then select 'jms' as the Event Adaptor Type.
  4. Enter details in the form that appears and click Add Event Adaptor button at the end of the form. For example,
  5. Enter details in the form that appears and click Add Event Adaptor button at the end of the form. For example,  
     
    Following values are used in the configuration above:   

    Event Adaptor Name                  : QpidJmsInputAdaptor
    Event Adaptor Type                  : jms
    JNDI Initial Context Factory Class  : org.apache.qpid.jndi.PropertiesFileInitialContextFactory (file-based JNDI properties)
    URL of the JNDI provider            : repository/conf/jndi.properties
    Connection Factory JNDI Name        : TopicConnectionFactory
    Destination Type                    : topic
    Enable Durable Subscription         : false
    This is the jndi.properties file in <PRODUCT_HOME>/reposiyory/conf directory. This example uses Topic Connection Factory. Therefore, the following entry points the default Qpid Host to localhost and port to 5672:
    connectionfactory.TopicConnectionFactory = amqp:
    //admin:admin@clientid/test?brokerlist='tcp://localhost:5672'
  6. After a adapter is successfully added, you can change its configuration and redeploy it. To do this, click the Edit link associated with it. You can also click the other links associated with it to delete it or enable statistics and tracing
  7. An XML based editor opens allowing you to edit the event adaptor configuration from UI itself, without having to edit the file in the file system.   Do your modifications and click Update.
  8. Alternatively, you can specify an event adaptor configuration using an XML file and save it in <PRODUCT_HOME>/repository/deployment/server/inputeventadaptors directory, which is the Input event adaptor deployment directory. Since hot deployment is enabled, you can simply add/remove files to deploy/undeploy from the server.

         Create the XML file with the following WSO2Event event adaptor configurations. Input event adaptor implementation must start with <inputEventAdaptor>root element.

<inputEventAdaptor name="QpidJmsInputAdaptor" statistics="disable"
  trace="disable" type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
  <property name="java.naming.provider.url">repository/conf/jndi.properties</property>
  <property name="transport.jms.SubscriptionDurable">false</property>
  <property name="java.naming.factory.initial">org.apache.qpid.jndi.PropertiesFileInitialContextFactory</property>
  <property name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</property>
  <property name="transport.jms.DestinationType">topic</property>
</inputEventAdaptor>

You can configure JMS event adaptors with Map, XML, JSON and Text Input Mapping.

WSO2 MB as Input JMS Event Adaptor

Follow the instructions below to configure WSO2 Message Broker (MB) as a JMS-Qpid Input Event Adaptor.

  1. Download and install Message Broker as described in the Message Broker documentation .

  2. Before starting the CEP, add the following JMS -specific JARs to <CEP_HOME>/repository/components/lib directory. If you plan to execute the Samples, add the JARs to <CEP_HOME>/samples/lib directory as well.   
    • <W SO2MB_HOME>/ client-lib/ andes-client-xx.jar    
    • <WSO2MB_HOME>/ client-lib/ geronimo-j2ee-management_1.1_spec-1.0.1xx.jar    

    You can configure this adaptor through the management console as explained below or by manually adding an XML file as explained in step 7.

  3. Log in to the CEP management console, go to Configure -->  Event Processor Configs --> Input Event Adaptors and then select 'jms' as the Event Adaptor Type.

    Enter details in the form that appears and click Add Event Adaptor button at the end of the form. For example,

    Following values are used in the configuration above:

    Event Adaptor Name                  : MBJmsInputAdaptor
    Event Adaptor Type                  : jms
    JNDI Initial Context Factory Class  : org.wso2.andes.jndi.PropertiesFileInitialContextFactory (file-based JNDI properties)
    URL of the JNDI provider            : repository/conf/jndi.properties
    Connection Factory JNDI Name        : TopicConnectionFactory
    Destination Type                    : topic
    Enable Durable Subscription         : false

    This is the jndi.properties file in <PRODUCT_HOME>/reposiyory/conf directory. This example uses Topic Connection Factory. Therefore, the following entry points the default Qpid Host to localhost and port to 5672:
    connectionfactory.TopicConnectionFactory = amqp:
    //admin:admin@clientid/carbon?brokerlist='tcp://localhost:5673' (MB starts with offset 1)

  4. After a adapter is successfully added, you can change its configuration and redeploy it. To do this, click the Edit link associated with it. You can also click the other links associated with it to delete it or enable statistics and tracing.
  5. An XML based editor opens allowing you to edit the event adaptor configuration from UI itself, without having to edit the file in the file system.   Do your modifications and click Update.
  6. Alternatively, you can specify an event adaptor configuration using an XML file and save it in <PRODUCT_HOME>/repository/deployment/server/inputeventadaptors directory, which is the Input event adaptor deployment directory. Since hot deployment is enabled, you can simply add/remove files to deploy/undeploy from the server.

    Create the XML file with the following WSO2Event event adaptor configurations. Input event adaptor implementation must start with <inputEventAdaptor> root element.

    <inputEventAdaptor name="MBJmsInputAdaptor" statistics="disable"
      trace="disable" type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
      <property name="java.naming.provider.url">repository/conf/jndi.properties</property>
      <property name="transport.jms.SubscriptionDurable">false</property>
      <property name="java.naming.factory.initial">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</property>
      <property name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</property>
      <property name="transport.jms.DestinationType">topic</property>
    </inputEventAdaptor>

    You can configure JMS event adaptors with Map, XML, JSON & Text Input  Mapping.

    Note: When using WSO2 MB as the Input Event Adaptor, at the time you define the Topic, which is a message-related property, follow the syntax Burl :{topic}. That is, add "Burl :" as the prefix of the actual topic. (When using with MB 2.0.1)

Configuring Input JMS Event Adaptor Message Properties

The configured Input Event Adaptors will be used in Event Builders, with Input Event Adaptor message properties, Event Builders will be able to extract data from the incoming events to build the event streams. Following are the Input JMS Event Adaptor specific message properties

  • Topic : The Topic/Queue name of JMS Message Broker
  • Input Mapping Type: The incoming event type to be mapped. The Input JMS Event Adaptor supports XML, Json, map and text mappings
  • No labels