[IGN-7976]Get Name of Message Handler Programmatically

No, this isn't directly possible. I wouldn't necessarily recommend going this route, but if you really wanted to, you can peek at the stack and find the 'filename' we feed into the Jython interpreter, which includes the handler name, which you could parse:

def handleMessage(payload):
	import sys
	filename = sys._getframe().f_code.co_filename
	# ex: <MessageHandlerScript:projectName/handlerName >	

I'll make a note to consider adding the handler name to this somehow. It'd be nice.

1 Like