0
votes

I am using wso2cep 3.0.0 and activemq5.8.0 As per CEP documents i wish to Publish events using CEP. For that i started activemq with 2 define QUEUES with the name jmsProxy for incoming message and JmsProxy for out message.I added required jars in CEP lib activemq-broker-5.8.0.jar,activemq-client-5.8.0.jar,axiom.jar,geronimo-j2ee-management_1.1_spec-1.0.1.jar,geronimo-jms_1.1_spec-1.1.1.jar,hawtbuf-1.2.jar,xpp3-1.1.4c.jar,xstream-1.4.4.jar

my configuration is like this InputEventAdaptor

<?xml version="1.0" encoding="UTF-8"?>
<inputEventAdaptor name="jmsProxy" statistics="disable" trace="enable"
  type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
  <property name="java.naming.provider.url">tcp://localhost:61616</property>
  <property name="transport.jms.SubscriptionDurable">true</property>
  <property name="transport.jms.DurableSubscriberName">jmsProxy</property>
  <property name="transport.jms.UserName">admin</property>
  <property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
  <property name="transport.jms.Password">admin</property>
  <property name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</property>
  <property name="transport.jms.DestinationType">queue</property>
</inputEventAdaptor>

above for incoming messages which will pick the messages from jmsProxy queue But its unable to pick the message from jmsProxy Queue.How would i initiate this to get the message into CEP and outputEventAdaptor I need to intialize some thing for jms could pick the messages from jMS why because i have tried in many ways all the configuration is ok but unable to pick the message from JMS

<?xml version="1.0" encoding="UTF-8"?>
<outputEventAdaptor name="JmsProxy" statistics="disable" trace="disable"
  type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
  <property name="java.naming.security.principal">admin</property>
  <property name="java.naming.provider.url">tcp://localhost:61616</property>
  <property name="java.naming.security.credentials">admin</property>
  <property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
  <property name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</property>
  <property name="transport.jms.DestinationType">queue</property>
</outputEventAdaptor>

event builder configuration like this

<?xml version="1.0" encoding="UTF-8"?>
<eventBuilder name="ReadingsDtoBuilder" statistics="disable"
    trace="disable" xmlns="http://wso2.org/carbon/eventbuilder">
<from eventAdaptorName="jmsProxy" eventAdaptorType="jmsProxy">
    <property name="transport.jms.Destination">JmsProxy</property>
</from>
<mapping customMapping="disable"
    parentXpath="//ReadingsLiteTaildtos" type="xml">
    <property>
        <from xpath="//ReadingsLiteTaildto/ParameterId"/>
        <to name="meta_parameterId" type="string"/>
    </property>
    <property>
        <from xpath="//ReadingsLiteTaildto/Slno"/>
        <to name="meta_slno" type="string"/>
    </property>
    <property>
        <from xpath="//ReadingsLiteTaildto/FinalValue"/>
        <to name="finalValue" type="int"/>
    </property>
    <property>
        <from xpath="//ReadingsLiteTaildto/InputText"/>
        <to name="inputText" type="string"/>
    </property>
    <property>
        <from xpath="//ReadingsLiteTaildto/InputValue"/>
        <to name="inputValue" type="double"/>
    </property>
</mapping>
<to streamName="org.sample.readings.dto.stream" version="1.0.0"/>
</eventBuilder>

The execution plan can be as follows.like this

<?xml version="1.0" encoding="UTF-8"?>
<executionPlan name="ReadingsAnalyzer" statistics="disable"
  trace="disable" xmlns="http://wso2.org/carbon/eventprocessor">
  <description>This execution plan analyzes readings and triggers notifications based on     threshold.</description>
  <siddhiConfiguration>
    <property name="siddhi.enable.distributed.processing">false</property>
    <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
  </siddhiConfiguration>
  <importedStreams>
    <stream as="readings" name="org.sample.readings.dto.stream" version="1.0.0"/>
  </importedStreams>
  <queryExpressions><![CDATA[from readings[finalValue > 100]
select *
insert into notificationStream;]]></queryExpressions>
  <exportedStreams>
    <stream name="notificationStream" valueOf="notificationStream" version="1.0.0"/>
  </exportedStreams>
</executionPlan

I defined streams inside stream-manager-config.xml similar to the following.

<streamDefinition name="org.sample.readings.dto.stream" version="1.0.0">
<metaData>
        <property name="parameterId" type="STRING"/>
        <property name="slno" type="STRING"/>
</metaData>
    <payloadData>
        <property name="finalValue" type="INT"/>
        <property name="inputText" type="STRING"/>
        <property name="inputValue" type="DOUBLE"/>
    </payloadData>
</streamDefinition>
<streamDefinition name="notificationStream" version="1.0.0">
<metaData>
        <property name="parameterId" type="STRING"/>
        <property name="slno" type="STRING"/>
</metaData>
    <payloadData>
        <property name="finalValue" type="INT"/>
        <property name="inputText" type="STRING"/>
        <property name="inputValue" type="DOUBLE"/>
    </payloadData>
</streamDefinition>

its look like all well while i am sending any message to my jmsProxy queue the message is not reflecting to CEP for event and i am getting this message in CEP. Means its unable to get the message into CEP and i am getting errors like this

[2014-02-18 11:57:53,159]  INFO - {EventBuilderDeployer}  Event Builder undeployed successfully : ReadingsDtoBuilder.xml
[2014-02-18 11:57:53,160]  INFO - {EventBuilderDeployer}  Event builder deployment held back and in inactive state :ReadingsDtoBuilder, Waiting for Input Event Adaptor dependency :jmsProxy
[2014-02-18 12:03:58,006]  INFO - {InputEventAdaptorConfigurationFilesystemInvoker}  Input Event Adaptor configuration deleted from file system : jmsProxy.xml
[2014-02-18 12:03:58,006]  INFO - {InputEventAdaptorDeployer}  Input Event Adaptor undeployed successfully : jmsProxy.xml
[2014-02-18 12:03:58,008]  INFO - {InputEventAdaptorConfigurationFilesystemInvoker}  Input Event Adaptor configuration saved in th filesystem : jmsProxy
[2014-02-18 12:03:58,009]  INFO - {InputEventAdaptorDeployer}  Input Event Adaptor deployed successfully and in active state : jmsProxy
[2014-02-18 12:03:58,009]  INFO - {EventBuilderDeployer}  Event Builder undeployed successfully : ReadingsDtoBuilder.xml
[2014-02-18 12:03:58,009]  INFO - {EventBuilderDeployer}  Event builder deployment held back and in inactive state :ReadingsDtoBuilder, Waiting for Input Event Adaptor dependency :jmsProxy

I am really fed up with wso2 docs no proper explanation on any topic.How its wirk how INCOMING message will get into input event builder Please help me to get out from this issue. Thanks in advance, Faisal shaik

1

1 Answers

0
votes

Looking at your configuration, it seems that you have specified the input adaptor type as 'jmsProxy' which is incorrect. It should be corrected as simply 'jms'. i.e.

<from eventAdaptorName="jmsProxy" eventAdaptorType="jms">

The way the JMS connection works is as follows. The connection details are specified by the Input event adaptor. But the subscription to a particular topic or listening on a particular queue happens only after the event builder configuration is specified since the topic/queue name is specified in the event builder configuration as the property 'transport.jms.Destination'.

So if you specified the Destination as 'JmsProxy' in the event builder configuration, make sure that a queue by the name of 'JmsProxy' exists in the ActiveMQ broker and that events are published to this queue.

The easiest way to troubleshoot the issue you are encountering would be to enable tracing of CEP artifacts. Each event goes through the sequence of Input Event Adaptor -> Event Builder -> Event Processor (Execution Plan) -> Event Formatter -> Output Event Adaptor. If you enable tracing of all 5 artifacts and tracing reports incoming and outgoing events at Input Event Adaptor and only incoming events at Event Builder, you can conclude that the issue is in the event builder configuration and so on.

If you still encounter an issue after fixing the Input Event Adaptor type, please enable tracing and share the relevant messages printed in the trace to identify in which artifact the issue is arising.

Hope this helps,