WSO2 Complex Event Processor is succeeded by WSO2 Stream Processor. To view the latest documentation for WSO2 SP, see WSO2 Stream Processor Documentation.
Skip to end of metadata
Go to start of metadata

WSO2 Message Broker (MB) JMS event receiver is an internal event receiver that comes with WSO2 products by default You can configure it with map, XML, JSON, and text input  mapping types.


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

  1. Download and install WSO2 Message Broker (MB). For instructions on WSO2 MB, go to Message Broker documentation.

  2. Configure WSO2 CEP by adding relevant libraries to support JMS transport.

  3. Open the  <CEP_HOME>/repository/conf/ file and register a connection factory  by entering relevant details in the register some connection factories section. Below is a sample for a connection factory named TopicConnectionFactory( the "carbon" is the name of the virtually hosted node in WSO2 MB).

    connectionfactory.TopicConnectionFactory=amqp://admin:[email protected]/carbon?brokerlist='tcp://localhost:5672'

Creating a WSO2 MB JMS event receiver 

For instructions on creating a WSO2 MB JMS event receiver, see Configuring CEP to Create Alerts.

Configuring adapter properties

Specify the Adapter Properties, when creating a WSO2 MB JMS event receiver using the management console as shown below.

WSO2 MB JMS input event adapter properties

After entering the above adapter properties, select the Event Stream to which you want to map the incoming events, and the Message Format which you want to apply on the receiving events. Also, click Advanced to define custom input mappings based on the Message Format you selected. For more information on custom input mapping types, see Input Mapping Types.  

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

<eventReceiver name="WSO2MBJMSInputEventAdapter" statistics="disable" trace="disable" xmlns="">
    <from eventAdapterType="jms">
        <property name="java.naming.factory.initial">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</property>
        <property name="java.naming.provider.url">repository/conf/</property>
        <property name="transport.jms.DestinationType">topic</property>
        <property name="transport.jms.SubscriptionDurable">false</property>
        <property name="transport.jms.Destination">test_topic</property>
        <property name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</property>
        <property encrypted="true" name="transport.jms.Password">P2ve4G8+qF7JXkiGnP9/Ew5GXALEWTu7znEwxZGYa/MQMaQBRfsXiP094fn9U+0rntdBMitXU9o7h5uV3m5h97Po8WTJRpnFBV5YCGZEO+ELSg6twY3386MipwFhFMrbUMKamI2sXksDRcogojWKtoHNmODnt8Ud1dh0LK5zqec=        </property>
        <property name="transport.jms.UserName">jms-user</property>
        <property name="transport.jms.DurableSubscriberName">subscriber</property>
        <property name="">SessionTransacted:false</property>

The above adapter properties are described below.

Adapter PropertyDescriptionConfiguration file propertyExample
Topic/Queue Name

Valid name for the JMS topic. WSO2 CEP/DAS sends and receives messages by subscribing to a topic or using named queues.

JNDI Initial Context Factory Class

JNDI initial context factory class. The class must implement the java.naming.spi.InitialContextFactory interface.

JNDI Provider URLURL of the JNDI provider.
The JMS connection passwordA valid password for the JMS connection.
The JMS connection usernameA valid username for the JMS connection.
Connection Factory JNDI NameThe JNDI name of the connection factory.
Destination TypeDefine the sort order for messages that arrive on a specific destination.
Enable Durable SubscriptionWhether the subscription is durable or not.
Durable Subscriber Name
A valid name of the durable subscriber (If any value added, Durable subscription will be enabled).
JMS Properties

Valid property and value pairs to denote Axis2 JMS properties (e.g. "property1: value1, property2: value2")

For more information on Axis2 JMS properties, go to Apache AXIS2 Transports Documentation.

Related samples

For more information on WSO2 MB event receiver type, see the following sample.

  • No labels