IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  property files in memory

    Posted Mon February 22, 2010 03:58 PM

    What is the best way to load a property file into memory so that it is available to all packages across the IS? I have tried a few different ways with no success.

    1. Used psUtilities/hashtable, don’t like the way that works… could be simpler IMHO
    2. Used psUtilities/memory, get exceptions with this one; suspect that there is a problem with class casting;
    3. Could use system properties, but that is not preferred and a last resort.

    Consider usage such as log4j, would like behavior like that.

    Fairly new to webMethods, any hints, suggestions, or examples would be appreciated.

    Thanks in advance.


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 2.  RE: property files in memory

    Posted Mon February 22, 2010 07:14 PM

    I allways work with a config file in a local directory and pick up it only when I need it.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: property files in memory

    Posted Mon February 22, 2010 07:21 PM

    Here’s another approach.

    Define a get Java service to retrieve a specific property.

    On the Shared tab, declare and define a static Properties object. Use a static initializer to load a file into that object.

    In the get service, retrieve the value of the property from the Properties object. Any service from any thread can call this service.

    If you need to refresh the object, do not assign null to the Properties object and create a new one. Instead, call clear and then reload. That will be thread safe.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 4.  RE: property files in memory

    Posted Tue February 23, 2010 01:23 AM

    I haven’t try but if you point your browser to extended settings, and click on Edit, you should be able to type:

    my.prop.name=1000
    my.prop.name2=abc

    Save and restart IS, then in your code do a:

    Config.getProperty(null, “my.prop.name”)

    You need to import wm.something.Config (Can’t remember full path)

    Thats “should” work. give it a try :smiley:


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: property files in memory

    Posted Tue February 23, 2010 06:06 AM

    If you put custom items in the Extended settings, it needs to be prefixed by watt. or it will not be loaded. (Or has that changed?)

    This technique is good for just a few properties. As the number increases, and the groupings of properties is needed, then this becomes unmanageable.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 6.  RE: property files in memory

    Posted Tue February 23, 2010 04:10 PM

    To me, using custom items in extended settings is like using system properties and not preferred.

    I do have something useful cooked - after much discussion with teammates regarding using hash and IData objects I decided on the simpler approach using properties. Willing to share, it is appropriate to post code? (still new! :slight_smile:


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB