CEP http receiver 一次可以接收多个数据节点吗
Can CEP http receiver receive multi data nodes one time
我使用 ESB 将 XML 消息转换为 CEP http 接收器,XML:
<result>
<event>
<tag>0101A01B001</tag>
<time>10:00:01</time>
<value>30.45</value>
</event>
<event>
<tag>0101A01B001</tag>
<time>10:00:02</time>
<value>33.7</value>
</event>
<event>
<tag>0101A01B001</tag>
<time>10:00:03</time>
<value>23.4</value>
</event>
<event>
<tag>0101A01B001</tag>
<time>10:00:04</time>
<value>33.15</value>
</event>
</result>
以及 CEP 中的 http 接收器:
<?xml version="1.0" encoding="UTF-8"?>
<eventReceiver name="recv_dss1" statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventreceiver">
<from eventAdapterType="http">
<property name="transports">all</property>
</from>
<mapping customMapping="enable" type="xml">
<property>
<from xpath="/result/data/tag"/>
<to name="tag" type="string"/>
</property>
<property>
<from xpath="/result/data/time"/>
<to name="time" type="long"/>
</property>
<property>
<from xpath="/result/data/value"/>
<to name="value" type="double"/>
</property>
</mapping>
<to streamName="dss_stream3" version="1.0.0"/>
</eventReceiver>
http receiver每次只接收第一个"event"节点,那么如何配置receiver一次可以接收所有"event"节点?
在配置中,您需要配置 "Parent Selector XPath Expression" 以指示事件的父元素,在本例中为 /result
。
那么应该从父标签引用事件的元素,例如/data/time
有关详细信息,请参阅 WSO2 CEP 4.1 XML 输入映射文档:https://docs.wso2.com/display/CEP410/Input+Mapping+Types#InputMappingTypes-XMLinputmappingXMLInputMapping
我使用 ESB 将 XML 消息转换为 CEP http 接收器,XML:
<result>
<event>
<tag>0101A01B001</tag>
<time>10:00:01</time>
<value>30.45</value>
</event>
<event>
<tag>0101A01B001</tag>
<time>10:00:02</time>
<value>33.7</value>
</event>
<event>
<tag>0101A01B001</tag>
<time>10:00:03</time>
<value>23.4</value>
</event>
<event>
<tag>0101A01B001</tag>
<time>10:00:04</time>
<value>33.15</value>
</event>
</result>
以及 CEP 中的 http 接收器:
<?xml version="1.0" encoding="UTF-8"?>
<eventReceiver name="recv_dss1" statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventreceiver">
<from eventAdapterType="http">
<property name="transports">all</property>
</from>
<mapping customMapping="enable" type="xml">
<property>
<from xpath="/result/data/tag"/>
<to name="tag" type="string"/>
</property>
<property>
<from xpath="/result/data/time"/>
<to name="time" type="long"/>
</property>
<property>
<from xpath="/result/data/value"/>
<to name="value" type="double"/>
</property>
</mapping>
<to streamName="dss_stream3" version="1.0.0"/>
</eventReceiver>
http receiver每次只接收第一个"event"节点,那么如何配置receiver一次可以接收所有"event"节点?
在配置中,您需要配置 "Parent Selector XPath Expression" 以指示事件的父元素,在本例中为 /result
。
那么应该从父标签引用事件的元素,例如/data/time
有关详细信息,请参阅 WSO2 CEP 4.1 XML 输入映射文档:https://docs.wso2.com/display/CEP410/Input+Mapping+Types#InputMappingTypes-XMLinputmappingXMLInputMapping