2 Replies Latest reply: Jan 25, 2012 10:23 AM by UmitAtas RSS

    Can one adapter create multi event to multi channel?

    UmitAtas
      Hello All,

      I have a socket reader adapter. I read socket data and genarate two types of events. One of them is positionEvent and other one is alarmEvent. I sent these events to seperate channels and seperate processor. But i have exception to processors. I think events sent all of the channels. Then processor throw exception.

      How can I send specific event to specific channel?

      Exception is :

      <Jan 23, 2012 10:51:05 AM VET> <Error> <CQLProcessor> <BEA-000000> <Failed to set property [information] of event type [UnitAlarm]. Cause = [information] is not a property of event type [UnitPosition]>


      config.xml



      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:osgi="http://www.springframework.org/schema/osgi"
      xmlns:wlevs="http://www.bea.com/ns/wlevs/spring"
      xmlns:jdbc="http://www.oracle.com/ns/ocep/jdbc"
      xmlns:spatial="http://www.oracle.com/ns/ocep/spatial"
      xsi:schemaLocation="
      http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans.xsd
      http://www.springframework.org/schema/osgi
      http://www.springframework.org/schema/osgi/spring-osgi.xsd
      http://www.bea.com/ns/wlevs/spring
      http://www.bea.com/ns/wlevs/spring/spring-wlevs-v11_1_1_3.xsd
      http://www.oracle.com/ns/ocep/jdbc
      http://www.oracle.com/ns/ocep/jdbc/ocep-jdbc.xsd
      http://www.oracle.com/ns/ocep/spatial
      http://www.oracle.com/ns/ocep/spatial/ocep-spatial.xsd">

           <wlevs:event-type-repository>
                <wlevs:event-type type-name="UnitPosition">
                     <wlevs:class>com.test.model.UnitPosition</wlevs:class>
                </wlevs:event-type>
                <wlevs:event-type type-name="UnitAlarm">
                     <wlevs:class>com.test.model.UnitAlarm</wlevs:class>
                </wlevs:event-type>
           </wlevs:event-type-repository>
           <wlevs:channel id="positionInputChannel" event-type="UnitPosition">
                <wlevs:listener ref="positionProcessor" />
           </wlevs:channel>
           <wlevs:processor id="positionProcessor">
                <wlevs:listener ref="positionOutputChannel" />
           </wlevs:processor>
           <wlevs:channel id="positionOutputChannel" event-type="UnitPosition">
                <wlevs:listener ref="bean" />
                <wlevs:listener ref="jmsPositionOutputAdapter" />
           </wlevs:channel>
           <bean id="bean" class="com.test.OutPrinterBean">
           </bean>
           <bean id="xmlConverter"
      class="com.test.XmlConverter"/>

           <wlevs:adapter id="jmsPositionOutputAdapter" provider="jms-outbound">
           <wlevs:instance-property name="converterBean" ref="xmlConverter"/>
           </wlevs:adapter>

           <wlevs:adapter id="SocketAdapter"
                class="com.test.adapter.SocketAdapter">
                <wlevs:listener ref="positionInputChannel" />
                <wlevs:listener ref="alarmInputChannel" />
           </wlevs:adapter>
           <wlevs:adapter id="jmsAlarmOutputAdapter" provider="jms-outbound">
           </wlevs:adapter>
           <wlevs:channel id="alarmInputChannel" event-type="UnitAlarm">
                <wlevs:listener ref="alarmProcessor" />
           </wlevs:channel>
           <wlevs:processor id="alarmProcessor">
                <wlevs:listener ref="alarmOutputChannel" />
           </wlevs:processor>
           <wlevs:channel id="alarmOutputChannel" event-type="UnitAlarm">
                <wlevs:listener ref="jmsAlarmOutputAdapter" />
           </wlevs:channel>
      </beans>



      thanks .