09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Working with Messaging Gateway<br />

Messaging Gateway dequeues from the AQ source queue during propagation. A<br />

transformation registered with an inbound subscriber is invoked by <strong>Advanced</strong><br />

<strong>Queuing</strong> when Messaging Gateway enqueues to the AQ destination queue during<br />

propagation.<br />

For example, trans_sampleadt_to_mgw_basic is a stored procedure<br />

representing a transformation function with the following signature:<br />

Transformation Function Signature: Example<br />

FUNCTION trans_sampleadt_to_mgw_basic(in_msg IN mgwuser.sampleADT)<br />

RETURN sys.mgw_basic_msg_t;<br />

Create a transformation using DBMS_TRANSFORM.CREATE as follows:<br />

begin<br />

dbms_transform.create_transformation(<br />

schema => 'mgwuser',<br />

name => 'sample_adt_to_mgw_basic',<br />

from_schema => 'mgwuser',<br />

from_type => 'sampleadt',<br />

to_schema => 'sys',<br />

to_type => 'mgw_basic_msg_t',<br />

transformation => 'mgwuser.trans_sampleadt_to_mgw_basic(user_data)');<br />

end;<br />

Once created, this transformation can be registered with Messaging Gateway when<br />

creating a subscriber.<br />

begin<br />

dbms_mgwadm.add_subscriber(<br />

subscriber_id => 'sub_aq2mq', -- MGW subscriber name<br />

propagation_type => dbms_mgwadm.outbound_propagation, -- outbound propaga<br />

queue_name => 'mgwuser.srcq', -- AQ queue name (source queue)<br />

destination =>'destq@mqlink', -- MGW foreign queue with link<br />

-- (destination queue)<br />

transformation => ‘mgwuser.sample_adt_to_mgw_basic’); -- transformation<br />

-- invoked on dequeue<br />

end;<br />

Exception Queues<br />

The exception queue stores messages for which conversion has failed. This queue<br />

must be on the same messaging system as the propagation source queue. If<br />

specified, a message for which conversion fails is moved to the exception queue<br />

18-24 <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!