Oracle AQ Java interface and custom message types

982 Views Asked by At

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?

1

There are 1 best solutions below

1
On

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.