I'm trying to enqueue a jms text message on oracle AQ from nodejs.
const enqueue = async () => {
try {
await oracle.createPool();
const connection = await oracle.getConnection();
const jmsMessageType = "SYS.AQ$_JMS_TEXT_MESSAGE";
const queue = await connection.getQueue(bv.REQUEST_QUEUE_NAME, {payloadType: jmsMessageType});
const theRequest = new queue.payloadTypeClass({
text_length: request.length,
text_vc: request
});
await queue.enqOne(theRequest);
await connection.commit();
} catch(e){
console.error(e);
}
}
enqueue();
I can see that the message is queued in the AQ's table in oracle, but the consumer breaks when trying to dequeue the message:
oracle.jms.AQjmsException: JMS-120: Dequeue failed
at oracle.jms.AQjmsError.throwEx(AQjmsError.java:337)
at oracle.jms.AQjmsConsumer.jdbcDequeueCommon(AQjmsConsumer.java:1995)
at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:1374)
at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:1292)
at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:1270)
at oracle.jms.AQjmsConsumer.receiveNoWait(AQjmsConsumer.java:1068)
...
Caused by: java.lang.NullPointerException
at oracle.jms.AQjmsTextMessage.readTextMessageContainer(AQjmsTextMessage.java:328)
at oracle.jms.AQjmsTextMessage.<init>(AQjmsTextMessage.java:161)
at oracle.jms.AQjmsConsumer.jdbcDequeueCommon(AQjmsConsumer.java:1751)
... 19 more
Any ideas on the correct structure of the JMSTextMessage type?
Basically just had to get the definitions of the types and user UPPER CASE for the property names. Upper case is very important - it just ignores lower case property names.
Look here if you need more: https://docs.oracle.com/cd/B10501_01/appdev.920/a96612/t_jms3.htm