Oracle8i Application Developer's Guide - XML Release 3 (8.1.7) Part Number A86030-01 |
Library | Service | Contents | Index

Phone Number Portability Using XML Messaging, 6 of 7

## Using Event Manager to Send and Receive Messages Asynchronously

SDP can send and receive messages asynchronously using Event Manager. Table 12-1 lists the queues and services in SDP that implement Event Management.

##### Table 12-1 SDP Queues and Services that Implement Event Management

Queue Name | Service Name | Remarks
--- | --- | ---
Inbound Message Queue | Message Server | Processes all incoming messages.
Internal Events Queue | Event Server | Events generated for internal consumption are enqueued on the internal events queue for speedy processing.
Outbound Message Queue | Communication Adapters | Dequeues messages from the Outbound Message queue and passes it to the peer system.

The Event Manager handles all messages entering the application system. Messages coming into the system can be responses to request messages or event notifications from remote systems.

### Example Code to Send Messages

Here is an example code fragment that constructs a PORT_IN message and sends it to the NRC consumer. The NRC consumer is a SDP adapter that delivers the message to the NRC system.

    DECLARE
    l_error_code	NUMBER ;
    l_error_message	VARCHAR2(2000) ;
    l_msg_header	XNP_MESSAGE.MSG_HEADER_REC_TYPE ;
    l_msg_text		VARCHAR2(4000) ;
    l_fnd_message	VARCHAR2(4000) ;
    BEGIN
    /*
    Create a PORT_IN request message
    */
    PORT_IN.CREATE_MSG(XNP$TN=>`3037505639'
      XNP$PORTING_ID=>1001,
      x_msg_header=>l_msg_header,
        x_msg_text=>l_msg_text,
            x_error_code=>l_error_code,
            x_error_message=>l_error_message,
            p_sender_name=>'TELIA') ;
          /*
    Notify the customer care system and get concurrence
    before sending the message to NRC
    */
    IF (l_error_code = 0) THEN

    /*
    Custom procedure to notify the customer care system
    */
    NOTIFY_CUSTOMER_CARE(l_msg_header,
    l_msg_text,
    l_error_code,
    l_error_message) ;
    IF (l_error_code = 0) THEN
     XNP_MESSAGE.PUSH(P_MSG_HEADER=>l_msg_header,
      P_BODY_TEXT=>l_msg_text,
      P_QUEUE_NAME=>XNP_EVENT.C_OUTBOUND_MSG_Q,
      P_RECIPIENT_LIST=>'NRC_ADAPTER' );
    ...

Messages can also be enqueued on the inbound messages queue or the internal events queue, however these queues are single consumer queues. Each queue can be shared by applications using correlation identifiers.

| Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index