webmethods 9.7 newfeatures _cp

Upload: anubha-agarwal

Post on 06-Jul-2018

230 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    1/19

    webMethods 9.7 Terracotta Integation - Exercises

    4BS Solutions www.4bs-solutions.com

    TABLE OF CONTENTS

    Exercise 1: Service Caching with Terracotta ....................................................... 3

    Exercise 2: Caching with Big Memory ................................................................ 9

    Exercise 3: Handling big XML Documents ......................................................... 14

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    2/19

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    3/19

    webMethods 9.7 Terracotta Integation - Exercises

    4BS Solutions www.4bs-solutions.com

    Exercise 1:Service Caching with Terracotta

    Overview

    In this exercise you test service caching and how it works with the new terracotta cache

    Task

    1. Enable the package V97TrainingESBSupport using the Integration Server packagemanagement on your VM before starting the first Exercise. Use IS Administration Web UI athttp://localhost:5555

    2. Create a new package called V97TrainingESB with a child folder called V97TrainingESB.

    3. Within the folder V97TrainingESB, create a folder called caching.In the upcoming steps youwill create a service that is used as “cached service” candidate

    4. In order to test caching, we need a service that we are going to cache. This will be a servicecalled “fak” computing n! = 1 * 2 * 3 * … * n for a given value of n. To simplify affairs, a javaprototype called javaFak already exists for you. Besides computing the n! function, it alsokeeps track how often it was invoked. This counter can be read by invoking thegetAndWipeCalls service, which resets the call counter as well.

    5. Create a Flow service called fak as shown below:

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    4/19

    Note: The input array for preserve in step 2 contains one entry, “fak” (3 letters, no quotes).

    6. Create a test service

    Next create a test Flow service called testCaching as shown below. This service invokes fakwith the arguments {1,1}; {1,2,2,1}; {1,2,3,3,2,1} up to {1, 2,…, 9, 10, 10, 9, …, 2. 1} and teststhe number of invocations after every call. To construct the argument sequences, anotherservice,called constructArgumentArray is provided.

    7. Verify Open the ServiceResults cache in the IS Administration UI (http://localhost:5555).This is where the cache can be configured. Some fields are greyed out because they cannot

    be changed with the Cache Manager running (there is a service in WmRoot to get aroundthis). You will notice that Maximum Elements in Memory and Maximum Elements on Diskhave been set to 5 so that the service results caching can be properly demonstrated. Theseare not meant to be recommended values for a typical ServiceResults cache on theIntegration Server. You do not have to make any changes for this exercise:

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    5/19

    webMethods 9.7 Terracotta Integation - Exercises

    4BS Solutions www.4bs-solutions.com

    8. Run the service testCaching without enabling caching in the fak service (“Cache results”property set to “False”). Verify it produces the following result in the server log:

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    6/19

    Note the number of calls to fak is 2 * N, just as expected. This proves that the results arenot cached.Run the Flow service V97TrainingESBSupport.support.caching:dumpServiceCacheto display the content of the service cache. You will notice that there are no keys stored.

    Note that this service is not suitable for caches containing a lot of keys. The service is shownhere:

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    7/19

    webMethods 9.7 Terracotta Integation - Exercises

    4BS Solutions www.4bs-solutions.com

    9. Set Cach e Results to “True” in the fak service and run the service testCaching again:

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    8/19

    Hint: Task 27.

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    9/19

    webMethods 9.7 Terracotta Integation - Exercises

    4BS Solutions www.4bs-solutions.com

    Exercise 2:Caching with Big Memory

    Overview

    In this exercise you will create a new Cache Manager and Cache that uses BigMemory. You willthen create and test a service that uses this cache.

    Task

    1. Form 1. To use BigMemory with the Integration Server (and Ehcache) you must have theappropriate license. To verify a license includes BigMemory, open the IS Administration WebUI and navigate to Settings > License > License Details:

    BigMemory should = yes .

    2. Set the amount of memory that you want to allocate to BigMemory. To do this, change

    MaxDirectMemorySize to 500M in ${InstallDir}\IntegrationServer\bin\setenv.bat

    3. Start the Server

    4. Create a new Cache Manager called TestCacheManager and a cache called Data that isconfigured to use BigMemory. Use IS Administration Web UI and the following screen shots todo this:

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    10/19

    After completing this step, you have a cache called “Data” managed by a cache manager called “TestCacheManager” that can hold 10 MB of data in BigMemory. These are not realistic valuesfor BigMemory but they get the point across. BigMemory can be used to have off heap storage inhundreds of GIGAbytes!

    Save your changes, and then start the Cache Manager (this will enable the cache).

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    11/19

    webMethods 9.7 Terracotta Integation - Exercises

    4BS Solutions www.4bs-solutions.com

    Now you will write a service to fill the cache with data.

    5. To fill the cache, you need to create a few objects on IS. First create the followingdocument type:V97TrainingESB.fillCache:cacheData:

    Note: randomData is of type Object List with Java wrapper type set to java.lang.Byte

    6. Finally, create a Flow service called filler in the fillCache folder to store random data in thecache as shown below. Set the “Repeat on” property to SUCCESS

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    12/19

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    13/19

    webMethods 9.7 Terracotta Integation - Exercises

    4BS Solutions www.4bs-solutions.com

    Now start the filler service and look how it slowly fills your cache with data. From a commandwindow, you can use the ${CourseDir}\ListCache.bat procedure to inspect the content of yourcache. Make sure you run env.bat first in ${CourseDir}.

    You will notice the service generateRandomData will keep running and running and running(because of the Repeat on Success). You can cancel it using the IS Administration Web UI (Server> Statistics > System Threads). Click the yellow checkmark beside the service to cancel it.

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    14/19

    Exercise 3:Handling big XML Documents

    Overview

    In this exercise you learn how the Terracotta cache and Big Memory are used to load big XMLDocuments.

    Task

    1. Setup environment

    2. Start a command prompt window, execute Env.bat

    3. Copy BigXML folder to${InstallDir}\IntegrationServer\packages\V97TrainingESBSupport\pub\BigXML

    4. Try to load a small (800KB) XML document from the server by typing the following commandin the command prompt:

    curl -u Administrator:manage

    http://localhost:5555/V97TrainingESBSupport/BigXML/rfclistSmall.xml

    5. Create Flow service called loadBigXML to load an XML document as shown below:

    6. Run this service. The file rfclistSmall.xml should load successfully.

    7. Now change the url to load the file rfclist.xml (about 220 MB) in the same folder. Your loadoperation will fail with an error similar to the one below:

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    15/19

    webMethods 9.7 Terracotta Integation - Exercises

    4BS Solutions www.4bs-solutions.com

    8. Configure IS to handle big XML documents.

    Allocate a bit more than 1 GB Direct Memory to handle big XML. Remember we used someDirect Memory in the exercises before this exercise.

    Restart Integration Server.

    9. Create a service Flow service called loadBigXMLEx to load big XML files as shown below:

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    16/19

    10. Next configure the IS to use “Enhanced XML Parsing” so that it uses Caching and BigMemory.

    In the IS Administration Web UI go to: Settings > Enhanced XML Parsing Edit the settingsusing the screenshot below as guidance. Save your changes and then enable Caching and BigMemory Caching.

    11. Now run the service loadBigXMLEx to load your big document. The load process takes about40-60 seconds, depending on your machine. Look at the Performance information in TaskManager and then the Peak Usage Statistics in the IS Administration Web UI. The Peak Usagestats will show you how much Big Memory was used. Note: you will have to refresh the ISAdmin web page to see the updated Peak Usage stats.

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    17/19

    webMethods 9.7 Terracotta Integation - Exercises

    4BS Solutions www.4bs-solutions.com

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    18/19

    12. Once you successfully loaded the document, create a Flow service called queryXML to query

    your loaded document as shown below:

  • 8/17/2019 WebMethods 9.7 NewFeatures _CP

    19/19

    webMethods 9.7 Terracotta Integation - Exercises

    This page intentionally left blank.