views:

169

answers:

1

I am using the Oracle Java interface for AQ and want to dequeue messages. These messages consist out of two fields:

  • A unique row id.
  • A non-unique id.

I successfully decoded messages using a single RAW payload like this:

AQDequeueOption option = new AQDequeueOption();
option.setDequeueMode(AQDequeueOption.DEQUEUE_REMOVE);

AQMessage message = queue.dequeue(option);
RAW raw = new RAW(message.getRawPayload().getBytes());

Integer rowId = Integer.valueOf(raw.stringValue());

I remember reading sth. along the lines that custom types are not supported in the Java interface. Is that so? How would the correspondent AQQueueTableProperty call look like or do I need to create the queue and queue table in SQL? Can't the result of the dequeue operation be mapped to a Java representation using the usual JDBC ResultSet operations?

A: 

I am not sure about the Java part, but I have used AQ quite a bit. If you are really struggling with the Java part, why not create a simple PLSQL procedure that wraps dequeue plsql api call and outputs parameters in a format Java can handle. Then you can simple call the wrapper from Java.

Sorry I cannot be more help on the Java side of things.

Stephen ODonnell
My current approach to solving the 'future message' problem (http://stackoverflow.com/questions/1763970/oracle-aq-dequeue-order) involves calling a package procedure during dequeueing so yes, I probably have no choice other than employing a PL/SQL procedure. JDBC-wise the result of such a queue would be an ordinary `ResultSet`, correct?
yawn