Announcement

Collapse
No announcement yet.

Web Service Listener Configuration File

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Web Service Listener Configuration File

    I was wondering if there's a way of getting a web service listener to refer to a configuration file (e.g. a *.properties file) which tells my web service which database etc. to communicate with, without having to hard-code this information into my custom web service listener class. When trying to re-use web services for different customers, I have to re-package a separate JAR for each customer, which is a bit tedious; it'd be better to have a one-size-fits-all listener, and simply change the path to the configuration file within Mirth Connect itself, rather than having to give every customer a different JAR for the same web service. Any ideas if this is possible, and how it could be achieved?

  • #2
    Assuming you'll be using this JAR within Mirth Connect, include mirth-server.jar on your classpath, and then you'll have access to the configuration controller. Grab the configuration map like this:

    Code:
    Map<String, String> configMap = ControllerFactory.getFactory().createConfigurationController().getConfigurationMap();
    String databaseHost = configMap.get("database.host");
    // Grab whatever else you need
    Now you can package and send the same JAR to everybody. In each Administrator instance, you can easily set those properties:

    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

    Nicholas Rupley
    Work: 949-237-6069
    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


    - How do I foo?
    - You just bar.

    Comment


    • #3
      Superb, thank you.

      I'd better upgrade to 3.1 then!

      Comment

      Working...
      X