Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @MessageDriven(
- activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic") },
- mappedName = "jms/MyTopic")
- public class MessageListener implements javax.jms.MessageListener {
- public MessageListener() {
- }
- /**
- * @see MessageListener#onMessage(Message)
- */
- public void onMessage(Message message) {
- if(message instanceof TextMessage){
- try{
- String text = ((TextMessage)message).getText();
- System.out.println("Message is: " + text);
- }catch(Exception e){
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement