Source:
public void processMessage(final ObjectMessage message) throws JMSException { final String messageType = message.getJMSType(); final String organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION); final String deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION); LOGGER.info("Received message of messageType: organisationIdentification: deviceIdentification: {}", messageType, organisationIdentification, deviceIdentification); final RequestMessage requestMessage = (RequestMessage) message.getObject(); final Object dataObject = requestMessage.getRequest(); try { final PushNotificationSms pushNotificationSms = (PushNotificationSms) dataObject; if (pushNotificationSms.getIpAddress() != null && !"".equals(pushNotificationSms.getIpAddress())) { LOGGER.info("Updating device IP address from to {}", deviceIdentification, requestMessage.getIpAddress(), pushNotificationSms.getIpAddress()); final InetAddress address = InetAddress.getByName(pushNotificationSms.getIpAddress()); final Device device = this.deviceRepository.findByDeviceIdentification(deviceIdentification); if (device != null) { device.updateRegistrationData(address, device.getDeviceType()); this.deviceRepository.save(device); } else { LOGGER.warn( "Device with ID = not found. Discard Sms notification request from ip address = of device", deviceIdentification, address); } } else { LOGGER.warn("Sms notification request for device = has no new IP address. Discard request.", deviceIdentification); } } catch (final Exception e) { LOGGER.error("Exception", e); throw new JMSException(e.getMessage()); } }

Target:
public void processMessage(final ObjectMessage message) throws JMSException { final String messageType = message.getJMSType(); final String organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION); final String deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION); LOGGER.info("Received message of messageType: organisationIdentification: deviceIdentification: {}", messageType, organisationIdentification, deviceIdentification); final RequestMessage requestMessage = (RequestMessage) message.getObject(); final Object dataObject = requestMessage.getRequest(); try { final PushNotificationSms pushNotificationSms = (PushNotificationSms) dataObject; this.storeSmsAsEvent(pushNotificationSms); if (pushNotificationSms.getIpAddress() != null && !"".equals(pushNotificationSms.getIpAddress())) { LOGGER.info("Updating device IP address from to {}", deviceIdentification, requestMessage.getIpAddress(), pushNotificationSms.getIpAddress()); final InetAddress address = InetAddress.getByName(pushNotificationSms.getIpAddress()); final Device device = this.deviceRepository.findByDeviceIdentification(deviceIdentification); if (device != null) { device.updateRegistrationData(address, device.getDeviceType()); this.deviceRepository.save(device); } else { LOGGER.warn( "Device with ID = not found. Discard Sms notification request from ip address = of device", deviceIdentification, address); } } else { LOGGER.warn("Sms notification request for device = has no new IP address. Discard request.", deviceIdentification); } } catch (final Exception e) { LOGGER.error("Exception", e); throw new JMSException(e.getMessage()); } }