Versions Compared

Key

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

ActiveMQ JMS event publisher is used to publish events in map, XML, JSON, and text  formats via JMS transport.

...

  1. Install  Apache ActiveMQ JMS

    Info

    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  the <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. Configure WSO2 CEP by adding relevant libraries to support JMS transport.

  4. Refer the <PRODUCT_HOME>/repository/conf/jndi.properties file to register a connection factory. For example, if the connection factory JNDI name is TopicConnectionFactory, it will point the default ActiveMQ host to localhost and port to 5672 as shown below. Furthermore, add the topics to be sent to the ActiveMQ broker in the format: topic.{topicName} = {topicName}

    Code Block
    languagetext
    connectionfactory.TopicConnectionFactory=amqp://admin:admin@clientid/test?brokerlist='tcp://localhost:5672'
    topic.topicMap = topicMap
    topic.topicText = topicText
  5. Start ActiveMQ, and then start the product.

...

For instructions on creating an ActiveMQ JMS event publisher, see Publishing Events .  Configuring CEP to Create Alerts.

Configuring 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.activemq.jndi.ActiveMQInitialContextFactory
JNDI Provider URL URL of the JNDI provider
java.naming.provider.url
tcp://localhost:61616
Username Valid username for the JMS connection
transport.jms.UserName
jms-user
Password Valid password for the JMS connection
transport.jms.Password
jms-password
Connection Factory JNDI Name The JNDI name of the connection factory
transport.jms.ConnectionFactoryJNDIName
TopicConnectionFactory
Destination Type The sort order for messages that arrive on a specific destination
transport.jms.DestinationType
topic/queue
Destination The topic or queue to which WSO2 CEP sends messages by publishing.
transport.jms.Destination
topicMap
Concurrent PublishersIf concurrent publishers are allowed to publish events to a JMS broker using multiple threads.transport.jms.ConcurrentPublishersallow

Dynamic adapter properties 

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 ActiveMQ event publisher type, see the following sample.