Oracle9i
Advanced Queuing Sample
Table Of Contents
Advanced Queuing ("AQ") is the message
queuing functionality of the Oracle database. With this functionality,
message queuing operations can be performed similar to that of SQL
operations from the Oracle database. This unique combination has added
benefits both for database users and the message queuing users. These
benefits have opened new avenues of applications. AQ offers added
functionality to better serve this new set of applications.
Message queuing functionality of AQ enables asynchronous communication
between applications/users on Oracle database using queues. It offers
multiple ways for applications to place a message in a queue called
enqueue and multiple ways for applications to get the message from a
queue called dequeue. In addition it offers ways to distribute the
messages to the appropriate queues called propagation. It offers
guaranteed delivery of messages along with exception handling in case
messages can't be delivered. It offers ways to prioritize the messages
and offers time properties for messages such as expiration and delays.
Notifications are also provided for immediate attention.
The features demonstrated in this sample
are explained briefly as follows:
- Internet Data Access Protocol (
IDAP )
An internet client application can communicate over HTTP(s) and Email
with a queue in Oracle database via XML-based protocol. This protocol
is named as Internet Data Access Protocol (IDAP). IDAP is the SOAP
specification for AQ operations. It also offers transactional access,
security, and characterset id conversions. This is useful for
communicating with customers and business partners via thin
applications on the client side. These applications can be simple
javascript that generate IDAP message and sent to AQ Servlet via
HTTP(s) POST. - Automatic
Message Propagation over the Net
This is a way to communicate with business partners and customers over
the Internet. This feature offers guaranteed, automatic, and tunable
propagation from a queue in an Oracle database to the queues in other
Oracle databases over the Internet. This is useful for automatic
communication with the business processes of the partners and
customers. - Message
Transformation
Advanced Queuing (AQ) is the database integrated message queuing
feature designed to meet the needs of coordination of the internal and
external business processes of an enterprise. Its offers message
transformation feature which can be used to transform and validate
message communication amongst different business processes. The message
transformations are defined as user defined SQL expressions which can
involve PL/SQL, Java, or C implemented functions. - E-mail / PLSQL Notification
AQ supports notifications which can be received in a PL/SQL procedure,
an OCI callback function, a JMS onMessage callback, an email
notification, and an HTTP post. You can register for notifications
using any of the APIs such as PL/SQL, OCI, Java (JMS), or IDAP
(XML-based API for AQ).
For more information about the architecture of
the sample, please see Architecture.html
For more
information on this technology, please click here.
User
Notes with Screen Shots
|
When the application is invoked, the first
page displayed is the Login Page which looks as follows :
Figure 1
All the users for the application have to
login through this page. The user can login as a customer to the Retail
Shop or as an administrator to the Retail Shop/ Computer Manufacture or
Printer Manufacturer Industries.
If, the user logged in is a Computer/Printer Manufacturer, then
the following page will be displayed to him :
Figure 2
Through this page, the administrator can
add, update or delete a product. On pressing the 'Add' button, a page
will be displayed to add the new product. After entering the product
information and on submitting the form, the Products page ( Figure 2 )
is again displayed with the updated information. The information
provided by the user is entered in a queue. The manufacturers database
is updated and then the message from the queue is propagated to the
Retail Database through the Message Propagation feature of AQ. There, a
PLSQL notification is called and Retail database tables are also
updated accordingly. The same thing happens if the administrator clicks
on 'Update' or 'Delete' button. In all the cases, the message is
propagated to the Retail Database and the requisite tables are updated
accordingly.
If, the user logged in is a Customer,
then the following page is displayed :
Figure 3
Initially, the shopping cart will be empty.
On this page, the customer can add items to the shopping cart, update
existing items in the shopping cart, delete items from the shopping
cart and order items present in the shopping cart. On selecting some
products and pressing the 'Add' button, the selected products will be
added to the Shopping Cart; the page displayed is :
Figure 4
For ordering, the IDAP feature of AQ is
used. The request for IDAP is basically a SOAP message which contains
the message to be enqueued. On pressing the "Order" button, a SOAP
message is generated and is shown as below :
Figure 5
When the message is enqueued through IDAP,
then a XML message is sent back by the database which tells us if the
enqueuing was successful or not. This message is shown by applying the
style sheet on the generated XML.
Figure 6
Now, the following page is displayed
which shows the order.
Figure 7
If, the user logged in is a Retail
Administrator, then the following page is displayed :
Figure 8
This page shows the information about the
various orders. The administrator can also see various details about an
order. When the admin checks a radio box accompanied for an order and
clicks on "Display Products" button, the products ordered in the order
will be displayed. This page is shown below :
Figure 9
- Oracle 9i Database
- OC4J 9.0.2 Production
- Oracle 9i Client; if database is
not installed on the same machine where OC4J is running
- JDK 1.3 and above downloadable from here
- Ant (downloadable from here)
- Internet Explorer 5.0 and above (Note:
Use IE 5.0 and above ideally as XML file cannot be displayed in
Netscape Navigator)
This
sample has been tested against
Installation
and Configuration
|
Refer to Installing
the sample for step-by-step instructions on extracting files,
installing and
configuring to successfully run this application.
Description
of Sample Files
|
The important sample files are described
below :
| Directory |
Filename |
Description |
| docs |
Readme.html |
This file |
| Install.html |
This file has instructions
required to deploy the application. |
| Architecture.html |
This file explains the
architecture of the sample. |
| sql |
AQCustomer.sql |
This SQL script runs the
required SQL commands in the Customer database for enabling AQ
features. It implements the Asynchronous Notification (E-mail and
PLSQL) and the Message Transformation features of AQ. |
| AQComputer.sql |
This SQL script runs the
required SQL commands in the Computer database for enabling AQ
features. It implements the Propogation feature of AQ. |
|