Menno,
From the documentation on clustered instances found here: https://docs.mendix.com/refguide/clustered-mendix-runtime
this does not seem possible.
Hi Erwin,
Thanks for your reply. I think it is not officially supported by Mendix. The runtime knows on which node to execute scheduled event. So the instance type (master or slave) should be stored/set somewhere; both on OS and Runtime level.
I tested the following on the Mendix Cloud and works as expected.
Create a Java action with the following code:
Long.valueOf(System.getenv("CF_INSTANCE_INDEX"));
This will return 0 for the Leader node and larger than 0 for the Slave nodes. Strange the JVM policy permits it, because if you emulate Cloud security locally, it will inject the following policy that prevents it for executing:
permission java.lang.RuntimePermission "getenv.CF_INSTANCE_INDEX";
Do not forget to catch exceptions properly, because if you run the application locally, it will not be able to read and parse the CF_INSTANCE_INDEX environment variable.
Is it useful to create a module for the community?!