Skip to content

Commit

Permalink
JMS: Add withProperties to all jms message types (#1752)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz authored and ennru committed Jun 25, 2019
1 parent 9c17a7c commit 087ccc5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions jms/src/main/scala/akka/stream/alpakka/jms/JmsMessages.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ sealed class JmsByteMessagePassThrough[+PassThrough] protected[jms] (val bytes:
def withProperty(name: String, value: Any): JmsByteMessagePassThrough[PassThrough] =
copy(properties = properties + (name -> value))

def withProperties(props: Map[String, Any]): JmsByteMessagePassThrough[PassThrough] =
copy(properties = properties ++ props)

def toQueue(name: String): JmsByteMessagePassThrough[PassThrough] = to(Queue(name))

def toTopic(name: String): JmsByteMessagePassThrough[PassThrough] = to(Topic(name))
Expand Down Expand Up @@ -198,6 +201,9 @@ sealed class JmsByteStringMessagePassThrough[+PassThrough] protected[jms] (val b
def withProperty(name: String, value: Any): JmsByteStringMessagePassThrough[PassThrough] =
copy(properties = properties + (name -> value))

def withProperties(props: Map[String, Any]): JmsByteStringMessagePassThrough[PassThrough] =
copy(properties = properties ++ props)

def toQueue(name: String): JmsByteStringMessagePassThrough[PassThrough] = to(Queue(name))

def toTopic(name: String): JmsByteStringMessagePassThrough[PassThrough] = to(Topic(name))
Expand Down Expand Up @@ -325,6 +331,9 @@ sealed class JmsMapMessagePassThrough[+PassThrough] protected[jms] (val body: Ma
def withProperty(name: String, value: Any): JmsMapMessagePassThrough[PassThrough] =
copy(properties = properties + (name -> value))

def withProperties(props: Map[String, Any]): JmsMapMessagePassThrough[PassThrough] =
copy(properties = properties ++ props)

def toQueue(name: String): JmsMapMessagePassThrough[PassThrough] = to(Queue(name))

def toTopic(name: String): JmsMapMessagePassThrough[PassThrough] = to(Topic(name))
Expand Down Expand Up @@ -451,6 +460,9 @@ sealed class JmsTextMessagePassThrough[+PassThrough] protected[jms] (val body: S
def withProperty(name: String, value: Any): JmsTextMessagePassThrough[PassThrough] =
copy(properties = properties + (name -> value))

def withProperties(props: Map[String, Any]): JmsTextMessagePassThrough[PassThrough] =
copy(properties = properties ++ props)

def toQueue(name: String): JmsTextMessagePassThrough[PassThrough] = to(Queue(name))

def toTopic(name: String): JmsTextMessagePassThrough[PassThrough] = to(Topic(name))
Expand Down Expand Up @@ -574,6 +586,9 @@ sealed class JmsObjectMessagePassThrough[+PassThrough] protected[jms] (val seria
def withProperty(name: String, value: Any): JmsObjectMessagePassThrough[PassThrough] =
copy(properties = properties + (name -> value))

def withProperties(props: Map[String, Any]): JmsObjectMessagePassThrough[PassThrough] =
copy(properties = properties ++ props)

def toQueue(name: String): JmsObjectMessagePassThrough[PassThrough] = to(Queue(name))

def toTopic(name: String): JmsObjectMessagePassThrough[PassThrough] = to(Topic(name))
Expand Down

0 comments on commit 087ccc5

Please sign in to comment.