Comments (13)
That should be possible! The POST /server/resources/{resourceId}/_reload
endpoint in the API can be used to programmatically reload a resource. The "default" resource created automatically with Connect points to the custom-lib folder and has an ID of Default Resource
.
from connect.
That should be possible! The
POST /server/resources/{resourceId}/_reload
endpoint in the API can be used to programmatically reload a resource. The "default" resource created automatically with Connect points to the custom-lib folder and has an ID ofDefault Resource
.
Questions about that approach:
- Do all channels are going to bounce when the resource reload happens?
- If so, Does Mirth will finish all channels that currently are processing msgs and once that is done then load the library.
I'm trying to avoid the loss of any msg in this process.
Thanks
from connect.
No channels will need to be redeployed and no messages will be interrupted. After the library resource is reloaded, on the next message your channel processes the new ClassLoader should be used, for example in a JavaScript script that uses your custom JAR.
from connect.
No channels will need to be redeployed and no messages will be interrupted. After the library resource is reloaded, on the next message your channel processes the new ClassLoader should be used, for example in a JavaScript script that uses your custom JAR.
This is awesome!
Thanks @narupley
from connect.
I want to followup in this question. I have a custom library that I wrote that I putted it in the custom_lib
folder. After that I clicked the reload button. I'm getting the error that the function is not found. I'm afraid that clicking the reload button is not refreshing/reloading/clearing
some sort of heap/ram/database
.
My idea of utilizing a library in jar
was to avoid to bounce Mirth.
Does anyone can bring some light to this issue?
from connect.
Does the JAR file should show up in the list of files in the Resource settings? You also need to make sure that the channel you're using includes that resource in the proper context (Summary tab, Set Dependencies, Library Resources). If you're using a custom library in the global scripts not tied to any channel, there is an option for that on the Directory Resource settings page.
from connect.
Does the JAR file should show up in the list of files in the Resource settings?
It does.
You also need to make sure that the channel you're using includes that resource in the proper context (Summary tab, Set Dependencies, Library Resources). If you're using a custom library in the global scripts not tied to any channel, there is an option for that on the Directory Resource settings page.
All those settings are set as expected. This is not the only library we are using and is not the only function from the library. This library is a class that has around 5 functions. So far we are using just one function. Now I want to use another function from the same jar/class
. That function was added today and I just replaced the jar
and clicked the reload. I have done that several times now and still can't see the new function.l
from connect.
Hmm I just tested it out and it appears to work fine for me. I tested using a custom JAR and a channel invoking it in a script, and then dropped a new version of the JAR into the directory. After reloading the resource the next message that flowed through the channel automatically used the new version of the JAR without needing to do anything else (no restarting or redeploying).
from connect.
Hmm I just tested it out and it appears to work fine for me. I tested using a custom JAR and a channel invoking it in a script, and then dropped a new version of the JAR into the directory. After reloading the resource the next message that flowed through the channel automatically used the new version of the JAR without needing to do anything else (no restarting or redeploying).
What version of Mirth are you using for the test?
Also, I deleted the jar
from custom_lib
, reload the resources, and saw that the jar
is no longer there, redeployed the channel, and the functions in the channel still load from the jar
that no longer exists. Witchcraft stuff man.
I'm wondering if there is a setting in Mirth that keeps custom_lib/
in memory until restarting Mirth?
from connect.
@diazgilberto This could happen if you have in your mirth.properties file the setting server.includecustomlib set to true. The description in the user guide says:
Determines whether libraries in the custom-lib directory will be included on the server classpath.
To reduce potential classpath conflicts you should create Resources and use them on specific channels/connectors instead, and then set this value to false
from connect.
@diazgilberto This could happen if you have in your mirth.properties file the setting server.includecustomlib set to true. The description in the user guide says:
Determines whether libraries in the custom-lib directory will be included on the server classpath.
To reduce potential classpath conflicts you should create Resources and use them on specific channels/connectors instead, and then set this value to false
I will check and let you know.
from connect.
@tonygermano that did the trick. Thanks so much. One last question. In the resources UI I can't find the resource ID of my .jar
. I need that to POST /server/resources/{resourceId}/_reload
.
Whare I can get that ID for remote reload my resources.
from connect.
{resourceId}
The {resourceId}
is the name of the library
from connect.
Related Issues (20)
- [IDEA] Upgrade rhino engine to version 1.7.14 HOT 2
- [BUG] Mirth REST API not exporting "new" channel version directly after edit HOT 1
- [BUG] Multiple connect servers - One database - minor issue HOT 10
- [BUG] Unable to start mirth client over ZTNA Proxy for mirth 4.0.0 or higher
- [IDEA] Upgrade from 4.0.0 to 4.1.0 lost all statistics HOT 4
- [BUG] SFTP Include All Subdirectories redundant requests HOT 9
- User who has a new PC and can't connect to server HOT 1
- [BUG] Username is case-sensitive when logging into MC Administrator HOT 6
- Add Chinese UI support HOT 3
- [BUG] Mirth Connect 4.2 dmg Doesn't recognize Java is Installed
- [BUG] Mirth Connect 4.2 Port in Use list is empty if local port is an variable HOT 5
- [BUG] MCAL 1.3.0 DMG installer cannot be verified by MacOS HOT 1
- Method failed: HTTP/1.1 500 Server Error HOT 1
- Update MSSQL jdbc driver HOT 1
- [BUG] Port in Use button does not report any use
- [BUG] MCAL 1.3 Frequent Crashes on macOS Monterey HOT 4
- Mac OS X Monterey 12.6.2 / Mirth 4.2, channel loading problems, openJDK HOT 2
- Spam on community board HOT 4
- [BUG] logger instance in a Filter step is object of class org.apache.logging.log4j.core.Logger while logger instance in Transformer step is instance of org.apache.log4j.Logger HOT 3
- [SECURITY] JSch library is outdated and unmaintained, switch to mweide implementation HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from connect.