Created
November 18, 2014 16:27
-
-
Save sachin-handiekar/6c43f436d5d46a5f653f to your computer and use it in GitHub Desktop.
OracleMessageListener
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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