Support Questions

Find answers, ask questions, and share your expertise

Routing from RouteOnAttribute to GetFile

avatar
Expert Contributor

I have to create a connection from RouteOnAttribute  processor to GetFile processor based on value of an attribute which I have set in processor preceding RouteOnAttribute .

But I am unable to do so on NiFi ui. Connection dialogbox jut doesn't appear.

What am I missing?

1 ACCEPTED SOLUTION

avatar
Super Guru

Ok, I think I know what you mean now.  Basically the GetFile is designed not to take any incoming connection as you can see in the processor documentation:

SAMSAL_1-1710925296183.png

The reason  such restriction applies depend on how the processor works. The GetFile is designed as a trigger processor and it executes every time a file is placed in the target path, so providing an incoming relationship (wither through routeOnAttribute or any other processor) will break this rule because that means the GetFile will only work and Get the file when upper stream processor triggers that via sending flowfile which is not what this processor is designed to do. What you need is FetchFile processor given that you know the file you are looking for because this processor takes the full file path and not just a directory.

 

View solution in original post

3 REPLIES 3

avatar
Super Guru

Hi , can you provide screenshot of the routeonattribute processor properties and relationship tabls configurations ? Also if you can provide a screenshot of the data flow and highlight what is missing?  that would be very helpful to the community to pin point what exactly the problem is.

avatar
Expert Contributor

This is RouteOnAttribute processor. As you can see I have 2 properties defined. I want to use fileTransfer property to route to GetFile processor.

manishg_0-1710924159787.png

And this is connection dialog box for one of the existing connections, and it lists 'fileTransfer' as a relationship.

manishg_1-1710924252034.png

 

avatar
Super Guru

Ok, I think I know what you mean now.  Basically the GetFile is designed not to take any incoming connection as you can see in the processor documentation:

SAMSAL_1-1710925296183.png

The reason  such restriction applies depend on how the processor works. The GetFile is designed as a trigger processor and it executes every time a file is placed in the target path, so providing an incoming relationship (wither through routeOnAttribute or any other processor) will break this rule because that means the GetFile will only work and Get the file when upper stream processor triggers that via sending flowfile which is not what this processor is designed to do. What you need is FetchFile processor given that you know the file you are looking for because this processor takes the full file path and not just a directory.