Skip to content

Commit

Permalink
Avoid recomputing metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
AL333Z committed May 30, 2024
1 parent d8766aa commit 8d6db07
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ class ServiceBusMessageContext[F[_], T](

override def enqueuedAt: Instant = underlying.getEnqueuedTime().toInstant()

override def metadata: Map[String, String] =
underlying.getRawAmqpMessage.getApplicationProperties.asScala.view.collect {
case (k, v: String) => (k, v)
override lazy val metadata: Map[String, String] =
underlying.getRawAmqpMessage.getApplicationProperties.asScala.view.collect { case (k, v: String) =>
(k, v)
}.toMap

override def ack(): F[Unit] =
Expand Down

0 comments on commit 8d6db07

Please sign in to comment.