Search in sources :

Example 1 with ReceiveInvalidSalesMessage

use of eu.europa.ec.fisheries.schema.exchange.module.v1.ReceiveInvalidSalesMessage in project UVMS-ExchangeModule-APP by UnionVMS.

the class ExchangeEventIncomingServiceBean method receiveInvalidSalesMessage.

@Override
public void receiveInvalidSalesMessage(@Observes @ReceiveInvalidSalesMessageEvent ExchangeMessageEvent event) {
    try {
        ReceiveInvalidSalesMessage request = JAXBMarshaller.unmarshallTextMessage(event.getJmsMessage(), ReceiveInvalidSalesMessage.class);
        exchangeLog.log(request, LogType.RECEIVE_SALES_REPORT, ExchangeLogStatusTypeType.FAILED, TypeRefType.SALES_REPORT, request.getRespondToInvalidMessageRequest(), true);
        producer.sendMessageOnQueue(request.getRespondToInvalidMessageRequest(), MessageQueue.SALES);
    } catch (ExchangeLogException e) {
        firePluginFault(event, "Could not log the incoming invalid sales message", e);
    } catch (ExchangeMessageException | ExchangeModelMarshallException e) {
        firePluginFault(event, "Error when receiving an invalid sales message from FLUX", e);
    }
}
Also used : ReceiveInvalidSalesMessage(eu.europa.ec.fisheries.schema.exchange.module.v1.ReceiveInvalidSalesMessage) ExchangeModelMarshallException(eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelMarshallException) ExchangeLogException(eu.europa.ec.fisheries.uvms.exchange.service.exception.ExchangeLogException) ExchangeMessageException(eu.europa.ec.fisheries.uvms.exchange.message.exception.ExchangeMessageException)

Aggregations

ReceiveInvalidSalesMessage (eu.europa.ec.fisheries.schema.exchange.module.v1.ReceiveInvalidSalesMessage)1 ExchangeMessageException (eu.europa.ec.fisheries.uvms.exchange.message.exception.ExchangeMessageException)1 ExchangeModelMarshallException (eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelMarshallException)1 ExchangeLogException (eu.europa.ec.fisheries.uvms.exchange.service.exception.ExchangeLogException)1