Wednesday, April 10, 2013

Integrating WSO2 BAM & WSO2 CEP

This post demonstrate how we can integrate both WSO2 BAM and WSO2 CEP and run them as a single instance.

To integrate both WSO2 BAM and WSO2 CEP we need to download BAM and install the CEP features form the WSO2 p2repo. Here I have used WSO2 BAM 2.2.0 and 4.0.7 p2repo. Follow the wiki link to get to know how to install new features to existing products.

Testing the installation.
To test the instillation add broker-manager-config.xml to repository/conf/, and add axis2_client.xml to repository/conf/axis2/.
Here axis2_client.xml has the email sender information, and I'm using a demo email account for this.

Then create a directory called 'cepbuckets' in repository/deployment/server/ and add bam-cep-kpi-analyzer.xml there.
In bam-cep-kpi-analyzer.xml, you will be able to find a line
<cep:output brokerName="emailBroker" topic="wso2cep.demo@gmail.com/Phone Purchase Notification">
Change "wso2cep.demo@gmail.com" to the endpoint use email ID, who needs to receive the notification.

Now if you run the KIP-analyser sample of BAM all the events that have totalPrice>350000 and quantity>3 will be notified to the user.

22 comments:

  1. In WSO2BAM do not change port offset (default port offset is 0), in WSO2BPS set port offset as 1 and in WSO2CEP set port offset as 2.
    In order to change the port offset go to, [wso2-server-home-location]/repository/conf/carbon.xml file and change the 0 as required. If you have been interested just click to Get More Info.

    ReplyDelete
  2. Chris,
    when I using wso2 cep, if I try to persist the middle calculation result, then lots of key words cannot be used, like "window.time, avg, sum, group by having"

    This configuration is:
    0


    If I change "0" to other number, like "5", then following expression will cause CEP parsing failure


    from singleEvent#window.time(60000)
    insert into outSingleEvent
    symbol, avg(price) as averagePrice, sum(price) as sumPrice
    group by symbol
    having symbol=='112'


    The error message is
    [2013-09-02 09:44:31,353] INFO {org.wso2.carbon.cep.siddhi.persistence.CasandraPersistenceStore} - found revision 1377849096435_SingleEventStream
    [2013-09-02 09:44:31,368] ERROR {org.wso2.carbon.cep.core.BucketDeployer} - wrong configuration provided for adding SingleEventStream.xml
    org.wso2.carbon.cep.core.exception.CEPConfigurationException: Error in initializing Siddhi backend Runtime,org.wso2.siddhi.core.query.projector.attribute.handler.avg.AvgOutputAttributeProcessorDouble
    cannot be cast to java.util.Map
    at org.wso2.carbon.cep.core.internal.CEPBucket.init(CEPBucket.java:109)
    at org.wso2.carbon.cep.core.internal.CEPService.deployBucket(CEPService.java:213)
    ... at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
    at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
    at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
    at org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:371)
    at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:59)
    at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:67)
    at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.runAxisDeployment(CarbonDeploymentSchedulerTask.java:67)
    at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.run(CarbonDeploymentSchedulerTask.java:112)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    Caused by: java.lang.ClassCastException: org.wso2.siddhi.core.query.projector.attribute.handler.avg.AvgOutputAttributeProcessorDouble cannot be cast to java.util.Map
    at org.wso2.siddhi.core.query.projector.attribute.processor.GroupByAttributeAggregatorProcessor.restoreState(GroupByAttributeAggregatorProcessor.java:53)
    at org.wso2.siddhi.core.query.projector.attribute.processor.AbstractAggregationAttributeProcessor.load(AbstractAggregationAttributeProcessor.java:88)
    at org.wso2.siddhi.core.persistence.PersistenceService.restoreRevision(PersistenceService.java:79)
    at org.wso2.siddhi.core.persistence.PersistenceService.restoreLastRevision(PersistenceService.java:104)
    ...
    ... 21 more
    [2013-09-02 09:44:31,372] INFO {org.apache.axis2.deployment.DeploymentEngine} - org.apache.axis2.deployment.DeploymentException: wrong configuration provided for adding SingleEventStream.xml



    ReplyDelete
  3. Useful information shared..I am very happy to read this article :)
    Buy essay.

    ReplyDelete
  4. I think this information can help everyone. Get More Info here.

    ReplyDelete
  5. Well, I think I still have a lot of to learn. I Get More Info here.

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. I still can not find how to do it, can someone help me? Get More Info

    ReplyDelete
  8. Online educational sources are idea for getting highest marks in your examinations because in this way you can best paper writing service where highly professional writers can help you.

    ReplyDelete
  9. This article is really nice! My brother would like this article! He is a programmer=) And I am essay writer. i earn money by writing essays for everyone. I am working at
    best custom essay service - called best-essays-writers.com. If you need essay - contact to our custom support and do your purchase.

    ReplyDelete
  10. Great blog! Yahoo. It is very interesting! Thanks for sharing! Geography Coursework

    ReplyDelete
  11. Hello, do you want to know how to help yourself to be the best student and have a lot of free time! If you have a lot of friends, if you want to save your time, if you need a help in such home tasks, I want to advice the best way in such tasks! It is http://custom-writing.net the best link for you and your best friends!

    ReplyDelete
  12. Nice post!Short and informative as I like,thanks for sharing!You can also try http://advanced-writer.com if you want get your education on the next level.

    ReplyDelete
  13. Thanks for this info,interesting post.Everybody who have writing problems can ask for help here essays-shark.net and get rid of all difficulties with one click

    ReplyDelete
  14. Hi to all! Super post and thanks for sharing! Academic life is ful of challenges! if you want to be successful in your studies use this site www.essay-mania.com.

    ReplyDelete
  15. Hello friends! I don't know almost anything about WSO2 BAM & WSO2 CEP .. If you can then write more about it. Sometimes we are lack of time but if I need to write smth I always use this source www.papers-writings.com where I used to order all needed writings of any type.

    ReplyDelete
  16. Thank you for posting so useful piece of information. Keep on working. All students that have troubles with academic paper writing are welcome to www.academic-writings.com. The team of professional writers will do a superb-quality and plagiarism free academic paper.

    ReplyDelete
  17. Hi, every one!! I think you agree with me that all student in every time, have difficulties with they essay! And this, true writing essay can be a little difficult, when you do that yourself! This why if you not enough time on this you can visit here http://essay-professors.com and order all you assignments here!

    ReplyDelete
  18. Essay writing services available online!

    ReplyDelete
  19. Thanks for this piece of information, it is very helpful in my work. Being persistent and hard-working is really very important if one wants to get ahead. Day after day training and refusing bad habits are definitely the nice keys to improve your skills and achieve success. Enter Grand-Essays Writing Service if you want to succeed in top quality papers writing.
    http://www.grand-essays.com/

    ReplyDelete
  20. This is a very nice post. Thanks for sharing with us. Keep it up webstagram

    ReplyDelete