How to search for messages based on size
I would like to search for all messages where their body size is greater than 3MB.
I have searched through the common Header and body properties and I have not found a size property. I have looked at the extended properties but I am unsure if any of the extended classes allows me to find the Doc size.
I have stepped through most of the body property classes related to messages or documents that have an exposed property that filters by document or message size.
Is there a way to do this within the Message Viewer or Terminal?
Thank you in advance.
Dan
Comments
What type of messages?
In general, a message is an instance of a persistent class, so "size" is a vague term.
Enrico
Right. The size of a message depends on what particular message type you're looking at. You could try something like:
SELECT M.FullSize FROM Ens.MessageHeader H JOIN EnsLib_HL7.Message M ON H.MessageBodyId=M.ID Where H.MessageBodyClassName='EnsLib.HL7.Message'
but it depends on the implementation of the message type you're looking at.
If you are talking about HL7 messages, you can use the property FullSize in a SQL statement:
SELECTIDFROM EnsLib_HL7.Message WHERE FullSize > ?Take care because this is a calulated proprety and doesn't have a index.
As others have mentioned, Size can be something of a "squishy" terrm depending on a variety of factors.
There's no single property that will work for all message classes; you do need to know the class and make sure it has a "Size" (or in the case of EnsLib.HL7.Message) "FullSize" property. And you can certainly add it as a search criteria in the Message Viewer:
.png)
.png)