I want to implement the request-reply pattern using Oracle AQ. Basically a "requestor" would:
It turns out that the in the DBMS_AQ.ENQUEUE procedure, the msgid OUT parameter which returns the original message ID is a RAW, while the correlation property of the dequeue options is a VARCHAR2(128).
What is the correct way to implement that?
Although I was afraid of simply trying to convert a RAW to a VARCHAR2 (after all, if the return of the API is a RAW, for me, this means that the bytes do not necessarily correspond to a String in a particular charset), it seems that it is just a matter of converting the RAW msgId to VARCHAR2 using TO_CHAR. Curiously, it does not work if you try to use UTL_RAW.CAST_TO_VARCHAR.
I will proceed with this approach, although it does not make me 100% confident.