apache nifi, groovy, get queue

41 Views Asked by At

I want to obtain the queues of a whole group of processes but I don't know how to do it, I managed to obtain the identifier of my group of processes but I can't anymore, the version of nifi is 1.11.4 and the version of my groovy is version 2.5.4

this my code groovy in the execute groovy

def flowFile = session.get()

if (flowFile) {
        def monthAgo = flowFile.getAttribute('monthago')
        if (queuesRemainingInGroup(monthAgo) == 0) {
            def newFlowFile = session.create()
            flowFile.getAttributes().each { key, value ->
                newFlowFile = newFlowFile.putAttribute(key, value)
            }
            session.transfer(newFlowFile, REL_SUCCESS)
        } else {
            log.info("eliminando Flujo")
            session.remove(flowFile)
        }
    }

def queuesRemainingInGroup(monthAgo) { 
    def processGroupId = context.procNode?.processGroupIdentifier ?: 'unknown' 
    
    log.info(processGroupId)
}
0

There are 0 best solutions below