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 />

‘MQ_SecurityExit’ for MQEnvironment.SECURITY_EXIT<br />

The following example configures a Messaging Gateway link to an MQSeries queue<br />

manager. The link is named ‘mqlink’ and is configured to use the MQSeries<br />

queue manager ‘my.queue.manager’ on host ‘myhost.mydomain’ and port<br />

1414, using MQSeries channel ‘mychannel’. This example also uses the options<br />

parameter to register an MQSeries SendExit class. The class ’mySendExit’ must<br />

be in the classpath of the Messaging Gateway agent (set in the mgw.ora file). Refer<br />

to "Modifying the mgw.ora Initialization File" on page 18-9 for information on<br />

setting the classpath of the Messaging Gateway agent.<br />

See Also: <strong>Oracle</strong>9i Supplied PL/SQL Packages and Types Reference,<br />

DBMS_MGWADM, for information on MQSeries system properties<br />

and supported options<br />

declare<br />

v_options sys.mgw_properties;<br />

v_prop sys.mgw_mqseries_properties;<br />

begin<br />

-- Set options.<br />

-- Specify an MQSeries send exit class ‘mySendExit’ to be associated with the<br />

queue.<br />

v_options := sys.mgw_properties(sys.mgw_property('MQ_SendExit', 'mySendExit’')<br />

);<br />

-- set certain MQSeries properties used for MQSeries<br />

v_prop := sys.mgw_mqseries_properties.construct();<br />

v_prop.max_connections := 1;<br />

v_prop.username := 'mqm'; -- username given to queue manager<br />

v_prop.password := 'mqm'; -- password given to queue manager<br />

v_prop.hostname := 'myhost.mydomain' -- hostname for queue manager host<br />

v_prop.port := 1414; -- port (1414 is MQSeries default)<br />

v_prop.channel := 'mychannel'; -- MQSeries channel name<br />

v_prop.outbound_log_queue := 'mylogq'; -- name of MQSeries queue to be<br />

-- used for MGW logging on<br />

-- outbound jobs.<br />

v_prop.queue_manager := 'my.queue.manager'; -- queue manager name<br />

dbms_mgwadm.create_msgsystem_link(<br />

linkname => 'mqlink', -- link name<br />

properties => v_prop, -- MQSeries driver properties<br />

options => v_options ); -- options<br />

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