A blog about my daily tech ramblings.

Saturday, 26 November 2011

Using Spring JMS with Oracle AQ [XMLType payload]

November 26, 2011 Posted by Sachin Handiekar , , , , 1 comment

Using Spring JMS with Oracle AQ [ Without Spring JDBC Extension ]


Code available at https://github.com/sachin-handiekar/spring-jms-oracle-aq

Create a queue table with XMLType payload


* Create a queue


Code 

AQ Connection factory


AQ Destination Factory



Message Listener for XMLType message



Message Listener Container



Sending XML Message to the queue

1 comment:

  1. Hello.

    I'm getting the this error:

    oracle.jms.AQjmsException: JMS-120: Dequeue failed
    at oracle.jms.AQjmsError.throwEx(AQjmsError.java:315)
    at oracle.jms.AQjmsConsumer.jdbcDequeue(AQjmsConsumer.java:1630)
    at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:1037)
    at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:962)
    at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:940)
    at oracle.jms.AQjmsConsumer.receive(AQjmsConsumer.java:792)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveMessage(AbstractPollingMessageListenerContainer.java:429)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:310)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
    at java.lang.Thread.run(Thread.java:680)
    Caused by: java.sql.SQLException: XMLTypeFactory can only work with OPAQUE
    at oracle.xdb.XMLTypeFactory.create(XMLTypeFactory.java:75)
    at oracle.jms.AQjmsConsumer.jdbcDequeue(AQjmsConsumer.java:1453)

    Could you help me ?

    ReplyDelete