09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Using HTTP to Access the AQ XML Servlet<br />

<br />

<br />

NUMBER01<br />

2000-08-23 0:0:0<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

4. The client sends an HTTP POST to the servlet at the remote server.<br />

See the $ORACLE_HOME/demo directory for sample code of POST requests<br />

using HTTP.<br />

AQ Servlet Processes a Request Using HTTP<br />

1. The server accepts the client HTTP(S) connection.<br />

2. The server authenticates the user (AQ agent) specified by the client.<br />

3. The server receives the POST request.<br />

4. The AQ servlet is invoked.<br />

If this is the first request being serviced by this servlet, the servlet is<br />

initialized—its init() method is invoked. The init () method creates a<br />

connection pool to the <strong>Oracle</strong> server using the AQxmlDataSource parameters<br />

(SID, host, port, AQ servlet super-user name, password) provided by the client.<br />

5. The servlet processes the message as follows:<br />

If this is the first request from this client, a new HTTP session is created.<br />

<br />

The XML message is parsed and its contents are validated. If a session ID is<br />

passed by the client in the HTTP headers, then this operation is performed<br />

in the context of that session. This is described in detail in the next section.<br />

The servlet determines which object (queue and topic) the agent is trying to<br />

<br />

perform operations on:<br />

For example, in the client request (step 3 in "AQ Client Request to the AQ<br />

Servlet Using HTTP"), the agent JOHN is trying to access OE.OE_NEW_<br />

ORDERS_QUE.<br />

The servlet looks through the list of database users that map to this AQ<br />

<br />

agent (using the AQ$INTERNET_USERS view). If any one of these db_<br />

17-60 <strong>Oracle</strong>9i Application Developer’s Guide - <strong>Advanced</strong> <strong>Queuing</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!