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=" Purchase Notification">
Change "" 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.


  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.

  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:

    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(
    at org.wso2.carbon.cep.core.internal.CEPService.deployBucket(
    ... at org.apache.axis2.deployment.repository.util.WSInfoList.update(
    at org.apache.axis2.deployment.RepositoryListener.update(
    at org.apache.axis2.deployment.RepositoryListener.checkServices(
    at org.apache.axis2.deployment.RepositoryListener.startListener(
    at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(
    at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.runAxisDeployment(
    at java.util.concurrent.Executors$
    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(
    at java.util.concurrent.FutureTask.runAndReset(
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(
    at java.util.concurrent.ScheduledThreadPoolExecutor$
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$
    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(
    at org.wso2.siddhi.core.query.projector.attribute.processor.AbstractAggregationAttributeProcessor.load(
    at org.wso2.siddhi.core.persistence.PersistenceService.restoreRevision(
    at org.wso2.siddhi.core.persistence.PersistenceService.restoreLastRevision(
    ... 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

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

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

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

  6. This comment has been removed by the author.

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

  8. Essay is a paperwork which often we meet as an assignment in high school or higher level education. Unfortunately, not few students consider that they have difficulty in writing essay as they feel that they lack in writing skill. I am one of them and I can tell you that in writing company real experts will create an academic work of superior quality for you.

  9. Interesting post. By the way, students do not have to worry anymore about writing essays. Using first-rate custom essay writing service, that are available 24/7, learners will always get professionally written essays.

  10. 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.

  11. Thanks for providing the information with this post. Post is very nice! By the way, I want to share with you information about the best essay writing service

  12. Life is beautiful! Don't waste your time on writing an essay ;) custom term papers

  13. hey hey!i am here accidentally and want to share with you the best site ever where you can order a unique essay for low price. is a reputable company with high quality custom paper writers

  14. 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 If you need essay - contact to our custom support and do your purchase.

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

  16. Thank you for another great article. Where else could anyone get that kind of information in such a perfect way of presentation.

    Working at best online mba programs

  17. 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 the best link for you and your best friends!

  18. Nice post!Short and informative as I like,thanks for sharing!You can also try if you want get your education on the next level.

  19. Thanks for this info,interesting post.Everybody who have writing problems can ask for help here and get rid of all difficulties with one click

  20. 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

  21. 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 where I used to order all needed writings of any type.

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

  23. 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 and order all you assignments here!

  24. Essay writing services available online!

  25. 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.