Versions Compared

Key

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

WSO2 CEP Samples : Access Analysis sample using Tuple mapping, Siddhi CEP Engine and local broker

...

Before creating the bucket to filter stock quotes it is essential to have a Carbon broker. Since In this example we are going to use agent Broker, it is needed to create a broker with type agent.To do that

  1. Start CEP Server.   Refer to the Running the Product for instructions.
  2. Login as admin.

  3. In the Configure menu you can find a Menu item called "Broker" and under that you can see sub menu 'Add' and click on that.

  4. You will get a page with header "Create a New Broker" and you need to enter following details in that form to create a agent broker.

    No Format
     Broker Name       : localAgentBroker 
     Type              : agent
     URL               : tcp://localhost:7611
     Authenticator URL : ssl://localhost:7711          
     User Name         : admin
     Password          : admin
  5. Finally click on Add Broker button and you will get the added broker to the list of available brokers.
  6. Repeat step 3 & 4 to create another new broker with following details.   

    No Format
     Broker Name       : externalAgentBroker 
     Type              : agent 
     URL               : tcp://localhost:7661    
     Authenticator URL : ssl://localhost:7761      
     User Name         : admin
     Password          : admin

    For more information about brokers visit here.

...

Note
As the last step of adding a bucket , click on save button. Once you clicked it will redirect to the deployed buckets page and deployed bucket will be appeared in buckets table. Further to check whether you have entered the details correctly you can click on the link with the defined bucket and it will show added details. You can come back to the previous adding bucket page by clicking on the back button provided or if needed to edit the bucket you can click on the "Edit" link on the top of the View bucket Page.

Invoking Deployed Bucket

When the bucket is successfully deployed, an axis2 service will be automatically created. To send events to bucket we can use that service. Also we can output subscriber to handle outputs using the output topic name.

Define output subscriber

When the user send events to CEP engine with this service, there should be a subscriber to the output topic given, when configuring the query of the bucket, to receive filtered events from the complex event processing engine. In this particular sample we need to host a thrift receiving server at specified address to receive output events. Following class will host a thrift receiver listening on ports specified when creating the bucket.

...