wso2siddhievent-stream-processingwso2-streaming-integrator

No extension exist for esbAnalytics:decompress


Iam trying to decompress incoming events with siddhi app on WSO2 Stream Processor. On earlier version (e.g. DAS) there was siddhi extension esbAnalytics:decompress, but if I use this extension in SP, there is error "No extension exist for esbAnalytics:decompress"

from FlowEntry#esbAnalytics:decompress(meta_compressed, meta_tenantId, flowData, messageId)
select messageFlowId, host, hashCode, componentName, componentType, componentIndex, componentId,  startTime, endTime, duration, beforePayload, afterPayload, contextPropertyMap, transportPropertyMap, children, entryPoint, entryPointHashcode, faultCount,metaTenantId, _timestamp
group by messageFlowId
insert into TestOutputFlowEntry;

Is there any way how to use esbAnalytics:decompress on SP or any other way how to decompress incoming flowEntry event? Thanks in advance.


Solution

  • esbAnalytic: decompress is a custom extension written in Siddhi 3 . In order to use it in SP, this needs to be ported to Siddhi 4 as there are API changes.

    Try out the custom extension writing guide, to port this. Also, Siddhi 4, identifies the extensions using annotations, this is commented out on the generated code for ease of use. Add the following to the extended Stream Processor as in math extension

    @Extension(
        name = "decompress",
        namespace = "esbAnalytics",
        description = "decompress function",
        examples = {
                @Example(
                        syntax = "FlowEntry" +
                                "#esbAnalytics:decompress(meta_compressed, meta_tenantId, flowData, messageId)\n",
                        description = "the above syntax can be used"
                )
        }
    )
    

    After writing the extension, place the jar in the {SP_HOME}/lib directory to use this in the Siddhi App.