BEA Logo BEA Tuxedo Release 8.0

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   Tuxedo Documentation   |   Using the BEA Tuxedo System /Q Component   |   Local Topics   |   Previous Topic   |   Next Topic   |   Contents

 


Building qsample

The following procedure provides instructions on building and running the qsample application.

  1. Make a directory for qsample and cd to it:
    mkdir qsampdir
    cd qsampdir

    This is suggested so you will be able to see clearly the qsample files you have at the start and the additional files you create along the way. Use the standard shell (/bin/sh) or the Korn shell; not the C shell (/bin/csh).

  2. Copy the qsample files.
    cp $TUXDIR/apps/qsample/* .

    You will be editing some of the files and making them executable, so it is best to begin with a copy of the files rather than the originals delivered with the software.

  3. List the files.
    $ ls
    README
    client.c
    crlog
    crque
    makefile
    rmipc
    runsample
    server.c
    setenv
    ubb.sample
    $

    The files that make up the application are:

    README

    A file that describes the application and how to configure and run it.

    setenv

    A script that sets environment variables.

    crlog

    A script that creates a TLOG file.

    crque

    A script that defines the queue space and queues for the application.

    makefile

    A makefile that creates the executables for the application.

    client.c

    The source code for the client program.

    server.c

    The source code for the server program.

    ubb.sample

    The ASCII form of the configuration file for the application.

    runsample

    A script that calls all the necessary commands to build and run the sample application.

    rmipc

    A script that removes the IPC resources for the queue space.

  4. Edit the setenv file.

    Open the setenv file and modify the TUXDIR value to the absolute path of the root directory of the BEA Tuxedo system installation. Remove the angle bracket characters (< and >) when editing this value.

  5. Run runsample.

    The runsample script contains several commands; each command is preceded by a comment line that describes the purpose of the command.

    #set the environment
    . ./setenv
    chmod +w ubb.sample
    uname="\Quname -n\Q"
    ed ubb.sample<<!
    g;<uname -n>;s;;${uname};
    g;<full path of Tuxedo software>;s;;${TUXDIR};
    g;<full path of APPDIR>;s;;${APPDIR};
    w
    q
    !
    #build the client and server
    make client server
    #create the tuxconfig file
    tmloadcf -y ubb.sample
    #create the TLOG
    ./crlog
    #create the QUE
    ./crque
    #boot the application
    tmboot -y
    #run the client
    client
    #shutdown the application
    tmshutdown -y
    #remove the client and server
    make clean
    #remove the QUE ipc resources
    ./rmipc
    #remove all files created
    rm tuxconfig QUE stdout stderr TLOG ULOG*

    When you run this script you will see a series of messages on your screen that are generated by the various commands. Included among them are the following lines:

    before: this is a q example
    after: THIS IS A Q EXAMPLE

    The before: line is a copy of the string that client enqueues for processing by server. The after: line is what server sends back. These two lines prove that the program worked successfully.

 

back to top previous page