Over a million developers have joined DZone.

Introducing JMSscala

DZone's Guide to

Introducing JMSscala

· Java Zone ·
Free Resource

Learn how to stop testing everything every sprint and only test the code you’ve changed. Brought to you by Parasoft.

JMSscala is a Scala Library to invoke JMS, the Java Message System.

It provides Scala interfaces, metaphors and conversions that lead to tighter code and less boilerplate.


val q=session.queue("yikes")      
val messageConsumer = q.consumer
    // clean up queue, consuming all messages

val prod = q.producer.deliveryMode(NON_PERSISTENT).send("Hello").send("World")

prod.sendMapWith(Map("one" -> 1, "two" -> 2))
 {_.propertiesMap(Map("someprop" -> "hello", "anotherprop" -> "Goodbye"))}

val messages=q.browser().messages
    case mess:TextMessage=>mess.asText
    case mess:MapMessage=>mess.asMap
  }.map("BROWSE "+_).mkString("\n"))

Get the top tips for Java developers and best practices to overcome common challenges. Brought to you by Parasoft.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}