use of org.springframework.jms.support.converter.MessageConversionException in project opennms by OpenNMS.
the class NrtBrokerJms method receiveMeasurementSets.
@Override
public List<MeasurementSet> receiveMeasurementSets(String nrtCollectionTaskId) {
List<MeasurementSet> result = new ArrayList<MeasurementSet>();
m_jmsTemplate.setReceiveTimeout(125);
Message message = m_jmsTemplate.receive(nrtCollectionTaskId);
while (message != null) {
MeasurementSet measurementSet;
try {
measurementSet = (MeasurementSet) simpleMessageConverter.fromMessage(message);
result.add(measurementSet);
} catch (JMSException ex) {
logger.error("Error receiving messages", ex);
return result;
} catch (MessageConversionException ex) {
logger.error("Error converting messages", ex);
return result;
}
message = m_jmsTemplate.receive(nrtCollectionTaskId);
}
return result;
}
use of org.springframework.jms.support.converter.MessageConversionException in project av-service by dvoraka.
the class JmsComponent method onMessage.
@Override
public void onMessage(Message message) {
requireNonNull(message, "Message must not be null!");
AvMessage avMessage;
try {
avMessage = (AvMessage) messageConverter.fromMessage(message);
messageInfoService.save(avMessage, AvMessageSource.JMS_COMPONENT_IN, serviceId);
} catch (JMSException | MessageConversionException e) {
log.warn("Conversion error!", e);
return;
}
notifyListeners(listeners, avMessage);
}
Aggregations