Hi 

I have been taking a look into the possibility of adding a PLC4x Listener to 
the NiFi integration. 

Under my research, and following how most of the ListenXXX processors in the 
standard-bundle of NiFi are, a good solution would be: 


    * A processor that starts a thread when it is scheduled. 
    * That thread connects to the plc and appends the messages received into a 
queue. 
    * The processor reads the messages from this queue only running when not 
empty. 

In particular ListenTCP and ListenUDP would be the closest ones to the 
implementation I describe. 

In order to account for inevitable disconnections I suggest including an 
additional queue prior to the queue that connects to the processor. Its 
function would be to check if the time to the last event is greater than x 
amount and reconnect in that case. 

As a proof of concept I already have a working version on 
https://github.com/zylklab/plc4x/tree/feature/nifi-integration-record-listener. 

I would appreciate your opinion on this feature. 
If you like it I can create a PR. 

Thanks you for your time! 

Unai Lería 

Reply via email to