infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Cloverleaf
Killing messages using an XLATE
Krishna Kumar
Killing messages
. Is there a way I can kill a message after checking its size in an XLATE?
If so can you please share the code?
Find more posts tagged with
Clovertech
Comments
jcobane1
Rather than killing it in an Xlate, it would be more efficient to kill it in a tps proc on the route prior to translation. Below is a snippet of code for the 'run' section of a tps proc for reference:
run {
# 'run' mode always has a MSGID; fetch and process it
keylget args MSGID mh
set disp "CONTINUE"
set msg [msgget $mh]
# get the message length in bytes
set msg_len [string bytelength $msg]
# check to see if the incoming message length in BYTES is more than 1MB
if { $msg_len > 1000000} {
set disp "KILL"
}
lappend dispList "$disp $mh"
}
return $dispList
Jim Kosloskey
If you really want this done in an Xlate then you could set the thread configuration to include the message in USERDATA; then in the Xlate (using Tcl) do a string length on the entire message returning the length; then using Xlate IF Action(s) decide what to do with the length the proc returned.
As an aside, a post I made earlier regards the related efficacy of Tcl vs Xlate filtering. My conclusion was there is little difference in performance. If you are interested, find that post or email me and I will send the product of my research.
And, no I do not have code to do specifically what you ask but it is pretty straightforward to do what I outlined above.