Example usage for javax.jms ObjectMessage toString

List of usage examples for javax.jms ObjectMessage toString

Introduction

In this page you can find the example usage for javax.jms ObjectMessage toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.chtijbug.drools.platform.backend.jms.JMSHistoryEventListener.java

@Transactional
public void onMessage(Message message) {
    HistoryEvent historyEvent = null;/*  w  w  w  .  ja  v  a 2 s  . c  o m*/
    try {
        if (message instanceof ObjectMessage) {
            ObjectMessage objectMessage = (ObjectMessage) message;
            Object messageContent = objectMessage.getObject();
            historyEvent = (HistoryEvent) messageContent;
            try {
                AbstractEventHandlerStrategy strategy = messageHandlerResolver
                        .resolveMessageHandler(historyEvent);
                strategy.handleMessage(historyEvent);
            } catch (Throwable e) {
                throw Throwables.propagate(e);
            }
            ObjectMessage msg = (ObjectMessage) message;
            LOG.debug("Consumed message: " + msg.toString());
        }
    } catch (Exception e) {
        LOG.error("Consumed message: " + e.toString() + " message content " + message.toString());
        LOG.error("                  message  " + message.toString());
        LOG.error("                  object content " + historyEvent.toString());

    }
}