class DomainResponseMessageProcessor implements MessageProcessor {

    @Override
    public void processMessage(final ObjectMessage message) {
        LOGGER.debug("Processing distribution automation response message");

        String correlationUid = null;
        MessageType messageType = null;
        String organisationIdentification = null;
        String deviceIdentification = null;

        ResponseMessageResultType resultType;
        String resultDescription;
        ResponseMessage dataObject;

        try {
            correlationUid = message.getJMSCorrelationID();
            organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION);
            deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION);

            messageType = MessageType.valueOf(message.getJMSType());

            resultType = ResponseMessageResultType.valueOf(message.getStringProperty(Constants.RESULT));
            resultDescription = message.getStringProperty(Constants.DESCRIPTION);

            dataObject = (ResponseMessage) message.getObject();
        } catch (final IllegalArgumentException e) {
            LOGGER.error("UNRECOVERABLE ERROR, received messageType {} is unknown.", messageType, e);
            logDebugInformation(messageType, correlationUid, organisationIdentification, deviceIdentification);

            return;
        } catch (final JMSException e) {
            LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
            logDebugInformation(messageType, correlationUid, organisationIdentification, deviceIdentification);

            return;
        }

        try {
            LOGGER.info("Handle message of type {} for device {} with result: {}, description {}.", messageType,
                    deviceIdentification, resultType, resultDescription);
            this.handleMessage(messageType, dataObject);
        } catch (final RuntimeException e) {
            handleError(e, correlationUid);
        }
    }

}