Can a JAR file be pushed to a specific MID Server instead of all MID Servers?


You may want to add a JAR file to a MID Server, but not have that file synchronised to all other MID Servers as well. As of the Orlando release, there is no out-of-box feature to do this.

Situation where this might be useful:


Manually copying the JAR file to the MID Server install folder is not a solution, as to protect the MID Servers from unauthorised JAR files, any JAR file found on the disk during synchronisation that is not in the JAR Files table of the instance is deleted [ecc_agent_jar].

Synchronisation happens whenever changes are made to the JAR file table in the instance, or whenever a MID Servers Starts up. The MID Servers query the instance for the list of JAR files. A customization to hide records in that query is possible.

A query business rule can hide certain records, for certain users, for non-interactive sessions. The isInterractive() in the conditions is important so that normal users looking at the JAR file records in the instance are not going to have them hidden.

Note: This will not prevent all MID Servers getting SystemCommands for any new or changed JAR file, triggering a re-sync and possibly a MID Server restart, even though they won't then be able to see the file, so won't actually sync it. A before insert abort action business rule on ecc_queue for these specific ecc_queue outputs (source=FileChange, name=ecc_agent_jar, topic=SystemCommand, queue=output) could be created, and delay the next resync until the mid server is restarted. That's not something the author has tested.

WARNING: Query business rules are tricky things. They hide records from out-of-box code as well as users and can cause unexpected behaviour, and side-effects in other code that wasn't considered when designing the business rule. This would be an unsupported customisation, and use this with care, and be sure to thoroughly test.

if (gs.getUserName() !== 'test_mid_server_user' && !gs.isInteractive()) {
current.addQuery('name','!=','Experimental JAR File');


Additional Information

Documentation: Synchronize a JAR file to MID Servers

There has been an Idea on the Community site requesting per-MID Server JAR files, but the Product Managers closed this.