Wednesday, November 19, 2014

Adding Siddhi extensions when using Siddhi as a Java library

You can write Siddhi extensions and run them in WSO2 CEP as given : https://docs.wso2.com/display/CEP310/Writing+Extensions+to+Siddhi

But if you are using Siddhi as a Java library then you can add then to SiddhiManager as follows

        List extensionClasses = new ArrayList();
        extensionClasses.add(org.wso2.siddhi.core.query.processor.window.UniqueWindowProcessorExt.class);
        
        SiddhiConfiguration siddhiConfiguration = new SiddhiConfiguration();
        siddhiConfiguration.setSiddhiExtensions(extensionClasses);
        
        SiddhiManager siddhiManager = new SiddhiManager(siddhiConfiguration);