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.

Modes of Dequeuing<br />

if MsgIsDequeued then<br />

set OraOrder = OraMsg<br />

OraItemList = OraOrder("items")<br />

OraItem = OraItemList(1)<br />

OraBook = OraItem("item")<br />

OraCustomer = OraOrder("customer")<br />

' Populate the textboxes with the values<br />

if( OraCustomer ) then<br />

if OraAq.Navigation ORAAQ_DQ_NEXT_MESSAGE then<br />

MsgBox " ********* NEXT ORDER *******"<br />

end if<br />

txt_book_orderno = OraOrder("orderno")<br />

txt_book_shipstate = OraCustomer("state")<br />

End if<br />

OraAq.Navigation = ORAAQ_DQ_NEXT_MESSAGE<br />

txt_book_title = OraBook("title")<br />

txt_book_qty = OraItem("quantity")<br />

Else<br />

MsgBox " ********* END OF ORDER *******"<br />

End if<br />

ErrHandler :<br />

'Handle error case, like no message etc<br />

If OraDatabase.LastServerErr = 25228 then<br />

OraAq.Navigation = ORAAQ_DQ_NEXT_TRANSACTION<br />

MsgIsDequeued = FALSE<br />

Resume Next<br />

End If<br />

'Process other errors<br />

end sub<br />

Java (JDBC): Example Code<br />

No example is provided with this release.<br />

Dequeue Features<br />

A dequeue request can either view a message or delete a message (see "Dequeuing a<br />

Message" on page 11-44 in Chapter 11, "Operational Interface: Basic Operations").<br />

To view a message, you can use the browse mode or locked mode.<br />

To consume a message, you can use either the remove mode or remove with no<br />

<br />

data mode.<br />

A Sample Application Using AQ 8-69

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

Saved successfully!

Ooh no, something went wrong!