Is there a preprocessor way to error out source messages based on size

0 votes
asked Jan 6, 2023 by chris-h-7652 (120 points)
Have a channel that takes pdf and sends them to a web api.  The source for some reason sometimes scans the pages at a real high dpi, and causes the files to be 500+ MB in size.  This has sometimes caused us issues with the channel not being able to handle that, and causing a server hang.

Is there a way I can detect the size of the file and error it out in a preprocessor?  Or do I need to convert this to a custom script where I can do the filtering directly on the file in the directory?

1 Answer

0 votes
Currently, there is no way to check the size before picking the file up.  It would be best to write a custom script that filters out the files.

If the receiving side can accept a full sized web service call like that, we have a new feature to call a REST web service with an output stream, this would allow you to create your payload using file streams, then push the entire payload to the receiving system using streams.  This allows you to handle large files without needing to read them up into memory.
answered Jan 6, 2023 by ben-s-7515 (12,640 points)