Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Introducing JMSscala

DZone's Guide to

Introducing JMSscala

· Java Zone
Free Resource

The single app analytics solutions to take your web and mobile apps to the next level.  Try today!  Brought to you in partnership with CA Technologies


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.

e.g.

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

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
  println(messages.map{
    case mess:TextMessage=>mess.asText
    case mess:MapMessage=>mess.asMap
  }.map("BROWSE "+_).mkString("\n"))

CA App Experience Analytics, a whole new level of visibility. Learn more. Brought to you in partnership with CA Technologies.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}