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

Introducing JMSscala

DZone's Guide to

Introducing JMSscala

· Java Zone ·
Free Resource

Java-based (JDBC) data connectivity to SaaS, NoSQL, and Big Data. Download Now.


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"))

Connect any Java based application to your SaaS data.  Over 100+ Java-based data source connectors.

Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}