All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.elasticmq.DeliveryReceipt.scala Maven / Gradle / Ivy

package org.elasticmq

import java.util.UUID

sealed case class DeliveryReceipt(receipt: String) {
  def extractId: MessageId =
    MessageId(receipt.split(DeliveryReceipt.Separator)(0))

  override def toString = receipt
}

object DeliveryReceipt {
  private val Separator = "#"

  def generate(id: MessageId) =
    new DeliveryReceipt(String.valueOf(id) + Separator + UUID.randomUUID().toString)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy