Lesson 1: Set up client and server components

To prepare your JMS provider
  1. Refer to your JMS server documentation to start the server.

  2. Create the following queues within your JMS server:

    • testmessage The TestMessage sample uses this queue name to listen for messages.
    • qanywhere_receive The QAnywhere JMS connector uses this queue name to listen for messages.

    You may need to restart the server after creating the queues. Refer to your JMS server documentation for more details.

To start the QAnywhere client and server components
  1. Create a QAnywhere JMS connector for your JMS system using Sybase Central. See Setting up JMS connectors.

  2. At the command prompt, run the following command:

    mlsrv11 -m -c "dsn=QAnywhere 11 Demo" -sl
    java(-cp JMS-client-jar-files) -vcrs
    -zu+

    where JMS-client-jar-files is a semicolon delimited list of jar files that are required to access the JMS server. See your JMS server documentation for details.

    The MobiLink server starts for messaging.

  3. From the Start menu, choose Programs » SQL Anywhere 11 » QAnywhere » Tutorial using SQL Anywhere » QAnywhere Agent For SQL Anywhere -- saclient1.

    The QAnywhere Agent loads.

  4. From the Start menu, choose Programs » SQL Anywhere 11 » QAnywhere » Tutorial using SQL Anywhere » TestMessage -- saclient1.

    The QAnywhere sample application loads.

To start the JMS version of the TestMessage client
  1. At the command prompt, run the following command:

    edit samples-dir/QAnywhere/JMS/TestMessage/build.bat
  2. Examine the code in the build.bat file and ensure that your JMS server file paths are correct.

    For example, if you use EAServer, the default settings are defined under the easerver heading:

    :easerver
    REM For EAServer, compile with the following JAR files
    SET easerver_install=c:\program files\sybase\easerver6
    SET jmsjars=%easerver_install%\lib\eas-client-15.jar
    goto build_app

    If EAServer is not located in the c:\program files\sybase\easerver6 directory, update the easerver_install variable so that it points to the proper install directory. Make sure that the jmsjars variable points to the proper location of the JMS server jar files.

    If your JMS server is not listed, use the custom header settings defined near the beginning of the batch file to define your own JMS file path locations.

    When finished, save your changes and exit the editor.

  3. At the command prompt, run the following command to compile the JMS TestMessage client:

    build.bat JMS-server-name

    where JMS-server-name is the name of your JMS server represented as a header name in build.bat. Acceptable values are easerver, fioranomq, jboss, tibco, weblogic, and custom. By default, build.bat uses easerver.

  4. At the command prompt, run the following command:

    edit samples-dir/QAnywhere/JMS/TestMessage/run.bat
  5. Examine the code in the run.bat file and ensure that your JMS server file paths are correct.

    For example, if you use EAServer, the default settings are defined under the easerver heading:

    :easerver
    REM For EAServer, compile with the following JAR files
    SET easerver_install=c:\program files\sybase\easerver6
    SET jmsjars=%easerver_install%\lib\eas-client-15.jar
    goto build_app

    If EAServer is not located in the c:\program files\sybase\easerver6 directory, update the easerver_install variable so that it points to the proper install directory. Make sure that the jmsjars variable points to the proper location of the JMS server jar files.

    If your JMS server is not listed, use the custom header settings defined near the beginning of the batch file to define your own JMS file path locations.

    When finished, save your changes and exit the editor.

  6. At the command prompt, run the following command to run the JMS TestMessage client:

    run.bat JMS-server-name

    where JMS-server-name is the name of your JMS server represented as a header name in build.bat. Acceptable values are easerver, fioranomq, jboss, tibco, weblogic, and custom. By default, build.bat uses easerver.

  7. Move the JMS TestMessage window to the right side of your screen under the existing TestMessage -- saclient1 window.