Java Code Examples for javax.jms.Message.getIntProperty()

The following are Jave code examples for showing how to use getIntProperty() of the javax.jms.Message class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: SpringTutorial   File: JmsMessageListener.java   Source Code and License Vote up 6 votes
/**
 * Implementation of <code>MessageListener</code>.
 */
public void onMessage(Message message) {
    try {   
        int messageCount = message.getIntProperty(JmsMessageProducer.MESSAGE_COUNT);
        
        if (message instanceof TextMessage) {
            TextMessage tm = (TextMessage)message;
            String msg = tm.getText();
            
            
            System.out.println("Processed message '{}'.  value={}"+ msg+ messageCount);
            
            counter.incrementAndGet();
        }
    } catch (JMSException e) {
        e.printStackTrace();
    }
}
 
Example 2
Project: SpringTutorial   File: JmsMessageListener.java   Source Code and License Vote up 6 votes
/**
 * Implementation of <code>MessageListener</code>.
 */
public void onMessage(Message message) {
    try {   
        int messageCount = message.getIntProperty(JmsMessageProducer.MESSAGE_COUNT);
        
        if (message instanceof TextMessage) {
            TextMessage tm = (TextMessage)message;
            String msg = tm.getText();
            
            
            System.out.println("Processed message '{}'.  value={}"+ msg+ messageCount);
            
            counter.incrementAndGet();
        }
    } catch (JMSException e) {
        e.printStackTrace();
    }
}
 
Example 3
Project: SpringTutorial   File: JmsMessageListener.java   Source Code and License Vote up 6 votes
/**
 * Implementation of <code>MessageListener</code>.
 */
public void onMessage(Message message) {
    try {   
        int messageCount = message.getIntProperty(JmsMessageProducer.MESSAGE_COUNT);
        
        if (message instanceof TextMessage) {
            TextMessage tm = (TextMessage)message;
            String msg = tm.getText();
            
            
            System.out.println("Processed message '{}'.  value={}"+ msg+ messageCount);
            
            counter.incrementAndGet();
        }
    } catch (JMSException e) {
        e.printStackTrace();
    }
}