Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This sample demonstrate the real-time analytics features of WSO2 BAM, by using the integrated WSO2 CEP features.

  • Create a new event stream:- Manage -> Event Processor -> Event Streams
    • Event Stream Name = "org.wso2.sample.rt.traffic"
    • Event Stream Version = "1.0.0"
    • Stream Attributes -> Payload Data Attributes
      • Attribute Name = "entry", Attribute Type - "string" -> Add
    • Add Event Stream
  • Create HTTP event output adaptor:- Configure -> Event Processor Configs -> Output Event Adaptors -> Name="HTTP" -> Type="http" -> Add Event Adaptor
  • Create a new execution plan:- name="rt_traffic_plan", import stream="traffic_sample_stream:1.0.0", as "traffic" -> Import
    • Query Expression="from traffic#window.time(1 sec) select count(entry) as entryCount insert into traffic_out;"
    • Export Stream, value of="traffic_out", streamId="–Create Stream Definition–" -> Use defaults -> Select "traffic_out:1.0.0"
      • Event Formatter -> "Custom Event Formatter"
        • Event formatter; name="rt_traffic_formatter", stream="traffic_out:1.0.0", output event adaptor="http_adaptor", output mapping="text"
        • output event adaptor name="HTTP"
        • output mapping content="{{entryCount}}"
        • url="https://localhost:9443/message_store?type=RT_SAMPLE_STATS"
        • username="admin", password="admin"
      • Add
  • Goto the BAM admin console, and goto "BAM Toolbox" -> Add -> Realtime Traffic Monitoring Toolbox -> Install
  • After the above actions are done, from a command line console, navigate to $BAM_SERVER/samples/rt-traffic, and type "ant". This will start executing a data publisher, and will be sending data continuously, the data rate of the items published here is happening randomly.
  • Navigate to "https://$host:9443/bamdashboards/rt_traffic/stats.jag" (here $host must be the exact host the server has started up, testing with "localhost" may not work, because of browser cross domain limitations). Now here, you will see a line graph being updated in real-time to show the frequency of the messages being published at that time.


  • No labels