Skip to content

Instantly share code, notes, and snippets.

@sachin-handiekar
Created October 15, 2011 11:45
Show Gist options
  • Save sachin-handiekar/1289453 to your computer and use it in GitHub Desktop.
Save sachin-handiekar/1289453 to your computer and use it in GitHub Desktop.
Enqueue JMS type message in Oracle AQ
declare
-- Local variables here
queue_options DBMS_AQ.ENQUEUE_OPTIONS_T;
message_properties DBMS_AQ.MESSAGE_PROPERTIES_T;
message_id RAW(16);
agent SYS.AQ$_AGENT := SYS.AQ$_AGENT(' ', null, 0);
my_message SYS.AQ$_JMS_TEXT_MESSAGE;
begin
my_message := SYS.AQ$_JMS_TEXT_MESSAGE.construct;
my_message.set_text('<< sample message >>');
-- Test statements here
DBMS_AQ.ENQUEUE(
queue_name => '<< queue_name >>',
enqueue_options => queue_options,
message_properties => message_properties,
payload => my_message,
msgid => message_id);
commit;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment