Announcement Announcement Module
Collapse
No announcement yet.
How to push/emit data to stream from Custom module Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to push/emit data to stream from Custom module

    I want to execute the below scenario --

    Create a stream -
    curl -d "tail | customtransform | sink" http://localhost:8080/streams/test

    I created a custom processor module customtransform which runs an instance of Esper Rule Engine. This would process the input data and output the rule-evaluated data to the sink.
    Now, as per the Esper API, the output of a rule is received in a listener 'update' method.
    Now from the 'update' method, how do I emit the evaluated data (String format would do) to the sink ?

    Thanks,
    Sudipti.

  • #2
    Sudipti,

    I'm also trying to setup Esper. I can't seem to get it to process through a listener either. I have tried setting up the Esper configuration in each of the modules. To me it seems like you can't wire tap within any of the modules.

    Does your configuration look similar to this?

    curl -d "door | transformdoor | esper " http://localhost:8080/streams/doormq

    Below is my esper.xml sink file

    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans xmlns="http://www.springframework.org/schema/integration"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:esper="http://www.opencredo.com/schema/esper"
    xmlns:si-esper="http://www.opencredo.com/schema/esper/integration"
    xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schem...ntegration.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
    http://www.opencredo.com/schema/esper http://www.opencredo.com/schema/espe...redo-esper.xsd
    http://www.opencredo.com/schema/esper/integration http://www.opencredo.com/schema/esper/integration/opencredo-integration-esper.xsd">

    <channel id="input"/>

    <logging-channel-adapter channel="input" level="INFO" logger-name="throughputCalculations"/>

    <!-- Starts the Esper wire tap -->
    <si-esper:wire-tap-channels default-wire-tap="wiretap">
    <si-esper:channel pattern="input" />
    </si-esper:wire-tap-channels>

    <si-esper:wire-tap id="wiretap" sourceId="defaultWireTap" template-ref="template" post-send="false" pre-receive="true" pre-send="false" post-receive="false" />

    <esper:template id="template" configuration="esper-configuration.xml">
    <esper:statements>
    <esper:statement
    epl="@Audit @Name('count') select count(*) as throughput from com.sensor.model.Door">
    <esper:listeners>
    <!-- Pass Esper messages to the inPlaceCollectionGateway -->
    <esper:ref bean="throughputGateway" />
    </esper:listeners>
    </esper:statement>
    </esper:statements>
    </esper:template>

    <si-esper:inbound-channel-adapter id="throughputGateway" channel="inboundRawEsperThroughputMessages" />
    </si-esper:inbound-channel-adapter>-->

    <channel id="inboundRawEsperThroughputMessages" />

    <transformer input-channel="inboundRawEsperThroughputMessages" output-channel="throughputCalculations" ref="throughputCalculationTransformer" />

    <beans:bean id="throughputCalculationTransformer" class="com.sensor.throughput.ThroughputCalculation Transformer" />

    <channel id="throughputCalculations"/>

    <logging-channel-adapter channel="throughputCalculations" level="INFO" logger-name="count"/>

    </beans:beans>

    Comment

    Working...
    X