Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. In the BAM management console click Main, and then click Execution Plans.
  2. Click Add Execution Plan.
  3. Enter rt_traffic_plan for Execution Plan Name.
  4. Under Import Stream select  org.wso2.sample.rt.traffic for Import Stream, and enter traffic for As.
  5. Click Import.
  6. Enter the following query expression in the provided space:
    from traffic#window.time(1 sec) select count(entry) as entryCount insert into traffic_out;
  7. Under Export Stream, enter traffic_out for Value of.
  8. Select Create Stream Definition for StreamId

    Creating the stream definition

    define event stream
  9. Enter traffic_out for Event Stream Name, and 1.0.0 for Event Stream Version.
  10. Click Add Event Stream.
  11. Select Custom Event Formatter from the message that pops up, and click OK.

    create custom event formatter

    Creating the Custom Event Formatter

    creating the custom event formatter
  12. Enter the following values to create a new event formatter:
    • Event Formatter Namert_traffic_formatter
    • Stream Attributes entryCount long
    • Output Event Adaptor Name - HTTP
    • URL - https://localhost:9443/message_store?type=RT_SAMPLE_STATS
    • Username - admin
    • Password - admin
    • Output Event Typetext
  13. Click Advanced, and type {{entryCount}} in the space provided under Output Mapping Content.
  14. Click Add Event Formatter.
  15. Under Export Stream, enter traffic_out for Value of, and select traffic_out:1.0.0 for StreamId, and click Add. 
  16. Click Add Execution Plan and select Yes in the message, which pops up.

...