Skip to content

Instantly share code, notes, and snippets.

@sachin-handiekar
Created November 3, 2011 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sachin-handiekar/1337875 to your computer and use it in GitHub Desktop.
Save sachin-handiekar/1337875 to your computer and use it in GitHub Desktop.
A custom Oracle AQ MessageListener (XML Type payload) for Spring JMS
package com.sachinhandiekar.oracle.aq;
import javax.jms.Message;
import javax.jms.MessageListener;
import org.springframework.transaction.annotation.Transactional;
import oracle.jms.AQjmsAdtMessage;
import oracle.xdb.XMLType;
public class OracleMessageListener implements MessageListener {
@Transactional
public void onMessage(Message message) {
try {
//Converting message into XmlType payload
XMLType xmlMsg = (XMLType) ((AQjmsAdtMessage) message).getAdtPayload();
System.out.println("XML Payload ==> " + xmlMsg.getStringVal());
}
catch (Exception e) {
// Catch any exception here
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment