Пример #1
0
  @Override
  public Transaction addTransaction(final Transaction transaction)
      throws ValidationFailedException {

    transaction.setReceivedTime(DateTime.now());
    transaction.setNodeName(clusterInfo.getNodeName());

    transactionValidator.validate(transaction);

    final Transaction savedTransaction = transactionDao.save(transaction);

    final KafkaMessageEnvelope<String, Transaction> kafkaMessageEnvelope =
        new KafkaMessageEnvelope<>(
            consumptionProperties.getKafkaClient().getTopicName(),
            savedTransaction.getTransactionId(),
            savedTransaction);
    consumerActorRef.tell(kafkaMessageEnvelope, null);

    return savedTransaction;
  }
Пример #2
0
 @Override
 public Transaction getTransaction(final UUID transactionId) {
   return transactionDao.load(transactionId);
 }