Search in sources :

Example 1 with MessageConversionException

use of org.springframework.amqp.support.converter.MessageConversionException in project av-service by dvoraka.

the class AmqpComponent 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.AMQP_COMPONENT_IN, serviceId);
    } catch (MessageConversionException e) {
        log.warn("Conversion error!", e);
        return;
    }
    notifyListeners(listeners, avMessage);
}
Also used : MessageConversionException(org.springframework.amqp.support.converter.MessageConversionException) AvMessage(dvoraka.avservice.common.data.AvMessage)

Example 2 with MessageConversionException

use of org.springframework.amqp.support.converter.MessageConversionException in project av-service by dvoraka.

the class AmqpReplicationComponent method onMessage.

@Override
public void onMessage(Message message) {
    log.debug("Receive: " + message);
    ReplicationMessage replicationMessage;
    try {
        replicationMessage = (ReplicationMessage) messageConverter.fromMessage(message);
        log.debug("Converted ({}): {}", nodeId, replicationMessage);
    } catch (MessageConversionException e) {
        log.warn("Conversion error!", e);
        return;
    }
    listeners.forEach(listener -> listener.onMessage(replicationMessage));
}
Also used : MessageConversionException(org.springframework.amqp.support.converter.MessageConversionException) ReplicationMessage(dvoraka.avservice.common.data.ReplicationMessage)

Aggregations

MessageConversionException (org.springframework.amqp.support.converter.MessageConversionException)2 AvMessage (dvoraka.avservice.common.data.AvMessage)1 ReplicationMessage (dvoraka.avservice.common.data.ReplicationMessage)1