how to run load tests on soa suite components using jmeter.pdf

Upload: robert-ochoa

Post on 08-Jul-2018

239 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    1/16

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    2/16

    24/10/13 Document Display

    https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=ksi2u85kw_9 2

          Muthu   

    3. Launch JMeter.

    4. Right click Test Plan and Add -> Threads (Users) -> Thread Group to create a new Thread group.

    5. Name the thread group (for example BpelHTTPTest).

    6. Specify the Thread properties.

    a. No. of Threads – Total number of concurrent threads required for this load test.

    b. Ramp up period – How long to take to initiate all the threads specified in No. of Threads parameter. For example if No. of Threads is 10 and the Ramp up period is 100 seconds, th

    to start all the threads.

    c. Loop Count. – How many times each thread should be executed.

    For eexample, in the above screenshot,

    No. of Threads = 5Ramp – Up Period = 0 seconds

    Loop count = 100

    The above thread group will run 5 concurrent threads (immediately create 5 concurrent threads because the Ramp-up period is 0), each thread will be executed 100 times, which results in 5

    example, the above parameters can be configured according to the requirement.

    7. Save the Test plan before making any more configuration.

    8. Now Add the sampler (which is the one that will send request to the end service, in our example to BPEL) by right clicking the newly created ThreadGroup -> Add -> Sampler -> SOAP/XM

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    3/16

    24/10/13 Document Display

    https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=ksi2u85kw_9 3

    9. Configure the sampler

    a. Provide the name for the sampler (for example BPELWebserviceTest)

    b. In the URL Field, enter the URL value which was copied in step1. For example http://:7001/soa-infra/services/default/LoadTestProj/httpbpelprocess_client_ep

    c. In the SOAP/XML-RPC Data field, enter the SOAP-Envelope copied from EM Console in step 2.

    d. Save changes.

    10. Above steps are sufficient to send load to the end service. But to understand whether the request is successful or not, we need to capture the result. JMeter provides multiple ways or fosample we are going to add some of them.

    11. Add listener configurations as below.

    a. Right click the Sampler and select Add -> Listener -> View Results in Tree

    b. Right click the Sampler and select Add -> Listener -> View Results in Table

    c. Right click the Sampler and select Add -> Listener -> Summary Report.

    (All the listeners will display results in a different format. Add the listeners according to your need).

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    4/16

    24/10/13 Document Display

    https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=ksi2u85kw_9 4

    12. Save changes and the JMeter project is completely ready to run the test.

    13. Make sure the BPEL server is up and running.

    14. In the JMeter menu, Run -> Start. This will start sending request to the endpoint configured and the Listeners which have been added in step 11 will show the results immediately.

    For example this is a result view of one request in View Results in Tree format.

    15. Check in EM Console whether the composite instances are created for the test run. In the above test run 500 requests should be sent to the BPEL Service LoadTestProj -> httpbpelproces

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    5/16

    24/10/13 Document Display

    https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=ksi2u85kw_9 5

    Sample Files

    Sample JMeter Plan file for HTTP BPEL Test can be downloaded from here   .

    Sample SOA project exposed as a webservice can be downloaded from here   .

    BPEL/ Mediator invoked through JMS Adapter 

    If the BPEL / Mediator instance is invoked through JMS Adapter, it is required to loa d the JMS queue with messages to run the load test. T his section shows how to load the r elated WebLogi

    1. Copy wlthint3client.jar from /server/lib folder to /lib folder and restart JMeter for the new jar file addition to the classpath to take effect.

    2. Follow the steps 3 – 7 from BPEL/Mediator webservice  section to create the Test Plan and the Thread group. Name the Thread group.

    3. Add JMS Point-to-Point sampler by right clicking the Thread Group -> Add -> Sampler -> JMS Point-to-Point.

    4. Configure the JMS Point-to-Point

    a. Name - Name Sampler with a meaningful name. (For example BPELJMSTest)

    b. QueuConnectionFactory – Provide a valid connection factory JNDI name. (For example LoadTestCF)

    c. JNDI Name Request Queue – Provide a valid Queue JNDI Name (For example LoadTestCF)

    d. Communication Style – Request only

    e. In the content section, enter the payload to be sent to the JMS queue.

    For example

      Muthu

    f. For Initial Context Factory enter the value “weblogic.jndi.WLInitialContextFactory” 

    g. For Provider URL enter the Server URL where the queue is located. (For eg. t3://:7001)

    h. Save the changes.

    http://-/?-https://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1384970.1:JDEVPROJECT&clickstream=nohttps://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1384970.1:HTTLOADTEST&clickstream=no

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    6/16

    24/10/13 Document Display

    https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=ksi2u85kw_9 6

    WLS Resources screen shot to show how you get the Queue Name and Connection Factory Name in the WLS console (http://:7001/console):

    5. Follow the steps 11 from BPEL/Mediator webservice  section to create the listeners for the above sampler.

    6. Save the Test plan.

    7. Go to menu Run -> Start. This will start sending request to the JMS Queue referred by the plan.

    8. Check the Listeners whether the request is successful or not.

    http://-/?-

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    7/16

    24/10/13 Document Display

    https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=ksi2u85kw_9 7

    In the above screenshot, 100 requests are sent and Error % is 0.00 which indicates all are successfully sent to the JMS Queue.

    9. Check whether the BPEL/Mediator and JMSAdapter got invoked by the JMS Message.

    Sample Files

    Sample JMeter Plan file for sending messages to JMS Queue can be downloaded from here   .

    Sample SOA project using JMSAdapter can be downloaded from here   .

    BPEL/ Mediator invoked through MQ Adapter 

    If the BPEL / Mediator instance is invoked through MQ Adapter, it is required to load the MQ queue with messages to run the load test. This section shows how to load the MQ queue using J

    1. Create a bindings file through JMSAdmin Utility provided by MQ for JMeter to send messages to MQ. JMSAdmin utility is located in \java\bin folder.

    - Edit JMSAdmin.config file for the below entries and save the changes.

    INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactoryPROVIDER_URL= file:D:\\JNDI-Directory

    - Create the text file with all the configuration required for creating ConnectionFactory, Queue in the bindings file. For example:

    #-----------------------------------------------------------------#MQ Configuration has MyQM as Queue Manager for this testing#MQ has SourceMQQueue queue for this testing.

    # Delete queue connection factoryDELETEQCF(LoadQCF)

    # define queue Connection Factory on the queue manager in MQ.

    DEFINE QCF(LoadQCF) qmgr(MyQM) tran(client) chan(SYSTEM.DEF.SVRCONN) +host(xx.xxx.xx.xxx) port(1414)

    DISPLAY QCF(LoadQCF)

    #-----------------------------------------------------------------

    # Delete the Queue if it existsDELETEQ(SourceMQQueue)

    # Define the QueueDEFINE Q(SourceMQQueue) qmgr(MyQM) qu(SourceMQQueue)

    # Display the resulting Queue definitionDISPLAY Q(SourceMQQueue)

    #-----------------------------------------------------------------# E N D O F J N D I D E F I N I T I O N S

    https://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1384970.1:JDEVPROJECT&clickstream=nohttps://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1384970.1:JMSLOADTEST&clickstream=no

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    8/16

    24/10/13 Document Display

    https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=ksi2u85kw_9 8

    -----------------------------------------------------------------end

    - Save the file with a name (for example Jms.scp).

    - Run the below command to create the bindings file

    JMSAdmin.bat –v < jms.scp

    - Check the location specified in PROVIDER_URL and verify that a .bindings file is created. This file will be used in JMeter to send the message to MQ.

    2. Copy the below jars from your MQ Installation into JMeter/lib folder and restart JMeter for the new libraries to be added into it’s classpath.

    - com.ibm.mq.jar- com.ibm.mqjms.jar

    - dhbcore.jar- fscontext.jar- providerutil.jar- connector.jar

    For this article, the above libraries are copied from a MQ 6 installation. If your MQ version is different, please refer to your MQ documentation and add the related client librar ies. JMeter will

    libraries from MQ.

    3. Follow the steps 3 – 7 from BPEL/Mediator webservice  section to create the Test Plan and the Thread group.

    4. Add JMS Point-to-Point sampler by right clicking the Thread Group -> Add -> Sampler -> JMS Point-to-Point

    5. Configure the JMS Point-to-Point

    a. Name - Name Sampler with a meaningful name. (For example BPELMQTest)

    b. QueuConnectionFactory – Provide a valid connection factory JNDI name. (For example LoadQCF)

    c. JNDI Name Request Queue – Provide a valid Queue JNDI Name (For example SourceMQQueue)

    d. Communication Style – Request only

    e. In the content section, enter the payload to be sent to the JMS Queue.

    For example:

      Muthu

    f. For Initial Context Factory enter the value “com.sun.jndi.fscontext.RefFSContextFactory” 

    g. For Provider URL enter the URL where the binding file was created earlier in step 1. (For example file:D:\\JNDI-Directory)

    h. Save the changes.

    http://-/?-

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    9/16

    24/10/13 Document Display

    https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=ksi2u85kw_9 9

    6. Follow the steps 11 from BPEL/Mediator webservice  section to create the listeners for the above sampler.

    7. Save the Test plan.

    8. Go to menu Run -> Start. This will start sending request to the JMS Queue referred by the plan.

    9. Check the Listeners whether the request is successful or not.

    http://-/?-

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    10/16

    24/10/13 Document Display

    https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=ksi2u85kw_9 10

    10. Check EMConsole and see whether the instances are getting invoked or not.

    Sample Files

    Sample JMeter Plan file for Sending messages to MQ Queue can be downloaded from here   .

    Sample SOA project using MQAdapter can be downloaded from here   .

    BPEL/ Mediator invoked through AQ Adapter 

    If the BPEL / Mediator instance is invoked through AQ Adapter, it is r equired to load the AQ queue with messa ges to run the load test. T his section shows how to load the A Q queue using JM

    This test uses a procedure to load the data into AQ Queue. The procedure can be run independently through any SQL Client. Running through JMeter will give more options of control and r u

    1. Follow the steps 3 – 7 from BPEL/Mediator webservice  section to create the Test Plan and the Thread group. Name the plan (For example AQBPELLoadTest)

    2. Add a JDBC connection by right clicking Thread Group -> Add -> Config Element -> JDBC Connection Configuration.

    - Name the configuration. (For example AQJDBCConn).

    - Provide a variable name (for example AQJDBCConn).

    - Specify the connection pool parameters according to your requirement.

    - Enter Database Configuration.

    o Database URL (for eg. jdbc:oracle:thin:@dbhost:1521/sid).

    o JDBC Driver Class - oracle.jdbc.xa.client.OracleXADataSource.

    o Username – AQ schema user name where AQ Queue is located.

    o Password – AQ Schema password.

    3. Create a JDBC Request Sampler by Right clicking Thread group -> Add -> Sampler -> JDBC Request

    - Name the Sampler (For example AQLoadTest).

    - Enter the variable name for the JDBC connection created on Step 2. (For example AQJDBCConn).

    - Select the query type as Callable Statement.

    - Enter the stored procedure to load the data into AQ Queue.

    -

    http://-/?-https://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1384970.1:JDEVPROJECT&clickstream=nohttps://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1384970.1:MQLOADTEST&clickstream=no

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    11/16

    24/10/13 Document Display

    https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=ksi2u85kw_9 11

     

    declare

    msg SYS.XMLType;queue_options DBMS_AQ.ENQUEUE_OPTIONS_T;msg_props DBMS_AQ.MESSAGE_PROPERTIES_T;msg_id RAW(16);

    begin

    for mesgno in 1..10 loopmsg := SYS.XMLType.createXML('' || mesgno || '');

    DBMS_AQ.ENQUEUE( queue_name => 'QIN',enqueue_options => queue_options,message_properties => msg_props,payload => msg,msgid => msg_id);commit;end loop;

    end;

    - Save the config.

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    12/16

    24/10/13 Document Display

    https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=ksi2u85kw_9 12

    4. Follow the steps 11 from BPEL/Mediator webservice  section to create the listeners for the above sampler.

    5. Save the Test plan.

    6. Go to menu Run -> Start. This will start sending request to the AQ Queue

    7. Check the Listeners whether the request is successful or not.

    8. Check EM Console whether the instances created successfully.

    Sample Files

    Sample JMeter Plan file for Sending messages to AQ Queue can be downloaded from here   .

    Sample SOA project using AQAdapter can be downloaded from here   .

    BPEL/Mediator invoked through DB Adapter 

    If the BPEL / Mediator instance is invoked through DB Adapter, it is required to load the DB table with records to run the load test. This section shows how to load the DB table using JMeter.

    1. Create JDBC Connection and the TestPlan as mentioned in BPEL/ Mediator invoked through AQ Adapter steps 1 and 2. Name the connection and Testplan.

    2. Create a counter to create a variable number to differentiate each record in table. Counter will create a running sequence number which can be used to create different data for each reco

    - Name the counter.

    - Enter start, increment and the maximum value for the counter

    - Provide a reference name for the counter which will be used in the sampler to get the value from this counter.

    http://-/?-https://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1384970.1:JDEVPROJECT&clickstream=nohttps://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1384970.1:AQLOADTEST&clickstream=nohttp://-/?-

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    13/16

    24/10/13 Document Display

    https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=ksi2u85kw_9 13

    3. Create a JDBC Request Sampler by right clicking Thread group -> Add -> Sampler -> JDBC Request

    - Name the Sampler (For example AQLoadTest)

    - Enter the variable name for the JDBC connection created in step 1.

    - Select the Query Type as “Prepared Statement Update”.

    - Enter the insert query according to the table columns. For testing, we created atable with the following 2 columns.

    "ROLLNO" NUMBER NOT NULL ENABLE,"NAME" VARCHAR2(50 BYTE)

    The insert query used for the above table is.

    INSERT INTO STUDENT1 VALUES(?,?)

    The above query uses dynamic parameter values which are specified by ?.

    - Enter the parameter values. Since the above sample uses 2 dynamic values, Parameter value should have 2 entries,

    ${rollNo},Muthu${rollNo}

    First entry is just an integer. Second entry is a name and appended with the counter value to create a unique name.

    In the above sample, rollNo is the Reference Name created on the counter on step 2.

    - Enter the parameter types. (comma separated for each parameter).

    4. Follow the steps 11 from BPEL/Mediator webservice  section to create the listeners for the above sampler.

    5. Save the Test plan.

    6. Go to menu Run -> Start. This will start inserting records into the DB Table.

    7. Check the Listeners whether the request is successful or not.

    http://-/?-

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    14/16

    24/10/13 Document Display

    https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=ksi2u85kw_9 14

    8. Login to EM Console and check whether the DBAdapter and it’s resources are invoked.

    Sample Files

    Sample JMeter Plan file for inserting records into DB table can be downloaded from here   .

    Sample SOA project using JMSAdapter can be downloaded from here   .

    BPEL/Mediator invoked t hrough FTP Adapter 

    If the BPEL / Mediator instance is invoked through FTP Adapter, it is required to load the ftp server with multiple files. This section shows how populate multiple files using JMeter.

    1. Follow the steps 3 – 7 from BPEL/Mediator webservice  section to create the Test Plan and the Thread group. Name the Thread group.2. Follow step 2 from BPEL/Mediator invoked through DB Adapter to create a counter to generate dynamic file name.

    http://-/?-https://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1384970.1:JDEVPROJECT&clickstream=nohttps://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1384970.1:DBLOADTEST&clickstream=no

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    15/16

    24/10/13 Document Display

    https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=ksi2u85kw_9 15

    3. Create a FTP Sampler request by right clicking Thread group -> Add -> Sampler -> FTP Request and configure the sampler to send files to ftp server.

    - Server name or IP: Specify the ftp server location

    - Port no: Specify the ftp server port number

    - Enter either a local file or local file contents for the file to be populated.

    - Select “Put” option as this sampler is going to create a file in ftp server.

    - Enter the login configuration (username and password for the ftp server).

    4. Follow the steps 11 from BPEL/Mediator webservice  section to create the listeners for the above sampler.

    5. Save the Test plan.

    6. Go to menu Run -> Start. This will start inserting records into the DB Table.

    7. Check the Listeners whether the request is successful or not.

    8. Check EM Console and be sure the FTP Adapter is able to pick the files and the instances are created.

    http://-/?-

  • 8/19/2019 How to Run Load Tests on SOA Suite Components using JMeter.pdf

    16/16

    24/10/13 Document Display

     

    Sample Files

    Sample JMeter Plan file for creating files on FTP Server can be downloaded from here   .

    Sample SOA project using FTPAdapter can be downloaded from here   .

    https://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1384970.1:JDEVPROJECT&clickstream=nohttps://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1384970.1:FTPLOADTEST&clickstream=no