Created
May 23, 2018 11:22
-
-
Save bdarfler/d0adb31efda90f2482ba21e053ae8270 to your computer and use it in GitHub Desktop.
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.company; | |
import javax.jms.JMSException; | |
import javax.jms.Message; | |
import javax.jms.MessageListener; | |
import javax.jms.TextMessage; | |
import org.springframework.stereotype.Component; | |
@Component | |
public class QueueListener implements MessageListener | |
{ | |
public void onMessage( final Message message ) | |
{ | |
if ( message instanceof TextMessage ) | |
{ | |
final TextMessage textMessage = (TextMessage) message; | |
try | |
{ | |
System.out.println( textMessage.getText() ); | |
} | |
catch (final JMSException e) | |
{ | |
e.printStackTrace(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment