Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Qpid JMS output event adapter can be Qpid JMS event publisher is used to publish events having in map, XML, JSON, and text formats via jms JMS transport.

Table of Contents
maxLevel3

Prerequisites

Follow the steps below to set up the prerequisites before starting the configuration.

  1. Install Qpid JMS Broker and Qpid JMS Client.

  2. Add the following Qpid JMS-specific JAR files to  <PRODUCT_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
  3. Refer Configure WSO2 CEP by adding relevant jars to support JMS transport.
  4. Register a connection factory in the <PRODUCT_HOME>/reposiyoryrepository/conf/jndi.properties file to register a connection factory and add the topics to be sent to the ActiveMQ broker. This example uses Topic Connection Factory. Therefore, the following entry points the default ActiveMQ host . For example, if the connection factory JNDI name is TopicConnectionFactory, it will point the default Qpid host to localhost and port to 5672 as shown below. Furthermore, add the topics to be sent to the Qpid broker in the format: topic.{topicName} {topicName}

    Code Block
    languagetext
    connectionfactory.TopicConnectionFactory=amqp://admin:admin@clientid/default?brokerlist='tcp://localhost:5672'
    
    topic.topicMap = topicMap

    
    topic.topicJSON = topicJSON
  5. Start Qpid Broker Broker, and then start the product. 

Creating a Qpid JMS event publisher

For instructions on creating a Qpid JMS event publisher, see Publishing Events .  

Configuring

...

adapter properties

 

 Qpid JMS output event adapter requires following adapter configurations;

 

Static Adapter Properties 

 

...

Adapter Property

...

Possible Values

...

Default

...

Description

...

Specify the Static and Dynamic Adapter Properties, when creating a Qpid JMS event publisher using the management console as shown below.

Qpid JMS publisherImage Added

Info

After entering the above adapter properties, select  the  Message Format   which you want to apply on the published events . Also, click  Advanced  to define custom output mappings based on the  Message Format  you selected. For more information on custom output mapping types, see  Publishing Events in Various Event Formats.

You can also define the respective adapter properties of the event publisher based on the transport type within the  <to>  element of the event publisher configuration in the <PRODUCT_HOME>/repository/deployment/server/eventpublishers/ directory as follows.

Code Block
languagexml
<eventPublisher name="QpidJMSOutputEventAdapter" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
  ..................
  <to eventAdapterType="jms">
    <property name="java.naming.factory.initial">org.apache.qpid.jndi.PropertiesFileInitialContextFactory</property>
    <property name="java.naming.provider.url">repository/conf/jndi.properties</property>
    <property name="transport.jms.UserName">jms-user</property>
    <property encrypted="true" name="transport.jms.Password">JP4yDiEh6HogOEjJzQQwHaJFIWZlnJTzaERl4eYrwukNeypm36R+odMkaN9b2q4H9jBQsRV+mhcT1wQVnBpEZn4a+SuFuLKh3NihDEgww6R1tZVo8p1D6TUKvSHXYEpwSOgKrkOmdaFEOQOjfdhfK3Hrnjkz/MYPYQknrLK5MIY=</property>
    <property name="transport.jms.DestinationType">topic</property>
    <property name="transport.jms.Header">header_name1:header_value1,header_name2:header_value2</property>
    <property name="transport.jms.Destination">test_topic</property>
    <property name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</property>
  </to>
</eventPublisher>

The above adapter properties are described below.

Static adapter properties 

Adapter Property
Description
Configuration file propertyExample
JNDI Initial Context Factory Class The JNDI initial context factory class. The class must implement the java.naming.spi.InitialContextFactory interface
java.naming.factory.initial

org.apache.qpid.jndi.PropertiesFileInitialContextFactory

JNDI Provider URL URL of the JNDI provider
java.naming.provider.url

repository/conf/jndi.properties

 URL of the JNDI provider.
Username A valid username for Valid username for the JMS connection Set a username for the JMS connection.
transport.jms.UserName
jms-user
Password A valid Valid password for the JMS connection Set a password for the JMS connection.
transport.jms.Password
jms-password
Connection Factory JNDI NameTopicConnectionFactory The JNDI name of the connection factory
transport.jms.ConnectionFactoryJNDIName
TopicConnectionFactory
Destination Type

topic/queue

topic

Define the The sort order for messages that arrive on a specific destination
transport.jms.DestinationType
topic/queue
Destination topicMap CEP send messages by publishing to a topic or a queue.

 

Dynamic Adapter Properties 

 

A valid header name: header value pair

eg
Adapter Property
Possible Values
Default
Description
HeaderThe topic or queue to which WSO2 CEP/DAS sends messages by publishing.
transport.jms.Destination
test_topic

Dynamic adapter properties 

value2Define Transport Headers
Adapter PropertyDescriptionConfiguration file propertyExample
Header Define transport headers as a valid header name in a header value pair format  transport.jms.Header header_name1:header_value1,header_name2:header_ value2 

Related samples

For more information on Qpid event publisher type, see the following sample.