use of org.orcid.listener.persistence.util.AvailableBroker in project ORCID-Source by ORCID.
the class S3MessageProcessor method accept.
public void accept(RetryMessage m) {
String orcid = m.getOrcid();
AvailableBroker destinationBroker = AvailableBroker.fromValue(m.getMap().get(RetryMessage.BROKER_NAME));
if (AvailableBroker.DUMP_STATUS_1_2_API.equals(destinationBroker)) {
update_1_2_API(orcid);
} else if (AvailableBroker.DUMP_STATUS_2_0_API.equals(destinationBroker)) {
update_2_0_API(orcid);
}
}
use of org.orcid.listener.persistence.util.AvailableBroker in project ORCID-Source by ORCID.
the class RetryListener method processMessage.
/**
* Processes messages on receipt.
*
* @param map
* @throws JsonProcessingException
* @throws JAXBException
* @throws AmazonClientException
*/
@JmsListener(destination = MessageConstants.Queues.RETRY)
public void processMessage(final Map<String, String> map) throws JsonProcessingException, AmazonClientException, JAXBException {
RetryMessage message = new RetryMessage(map);
String orcid = message.getOrcid();
if (message.getMap() == null || message.getMap().get(RetryMessage.BROKER_NAME) == null) {
throw new MissingResourceException("Unable to find destination broker", String.class.getName(), RetryMessage.BROKER_NAME);
}
AvailableBroker destinationBroker = AvailableBroker.fromValue(message.getMap().get(RetryMessage.BROKER_NAME));
LOG.info("Recieved " + MessageConstants.Queues.RETRY + " message for orcid " + orcid + " to broker " + destinationBroker);
if (AvailableBroker.DUMP_STATUS_1_2_API.equals(destinationBroker) || AvailableBroker.DUMP_STATUS_2_0_API.equals(destinationBroker)) {
s3Processor.accept(message);
} else if (AvailableBroker.SOLR.equals(destinationBroker)) {
solrProcessor.accept(message);
}
}
Aggregations