MSMQ Component

The msmq: component is a transport for working with Microsoft Message Queuing
This component natively sends and receives directly allocated ByteBuffer instances. This allows you to access the JNI layer without expensive memory copying.
In fact, if a ByteBuffer is created by the allocateDirect method, it can be passed to the JNI layer and the native code is able to access the memory directly.
It's up to the developer to marshal/unmarshal any other kinds of payload to/from directly allocated ByteBuffer instances.
Look at the tests to see some usage examples.

URI format

msmq:msmqQueueName[?options]

You can append query options to the URI in the following format, ?option=value&option=value&...

Examples

msmq:DIRECT=OS:localhost\\private$\\test?concurrentConsumers=1
msmq:DIRECT=OS:localhost\\private$\\test?deliveryPersistent=true&priority=5&timeToLive=10

Options

Name Default Value Description
deliveryPersistent false If true, the message is put persistently on the queue.
priority 5 The message priority, lying in the range 1-7
timeToLive INFINITE The maximum amount of time (specified in seconds) that a message can spend travelling to its destination. If this limit is exceeded, the message is discarded.
concurrentConsumers 1 The numbers of consumers that get messages from the queue at the same time.
initialBufferSize 128 The initial buffer size
incrementBufferSize 128 If the initial buffer size is not enough big for the received message, it is incremented by incrementBufferSize

Using camel-msmq

To use this module you need to use the FUSE Mediation Router distribution. Or you could just add the following to your pom.xml file, substituting the version number for the latest & greatest release:

<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-msmq</artifactId>
  <version>1.6.1.1-fuse</version>
</dependency>

And make sure you are pointing at the following maven repository:

   <repository>
     <id>open.iona.m2</id>
     <name>IONA Open Source Community Release Repository</name>
     <url>http://repo.open.iona.com/maven2</url>
     <snapshots>
       <enabled>false</enabled>
     </snapshots>
     <releases>
       <enabled>true</enabled>
     </releases>
   </repository>

Building From Source

The source for camel-msmq is available here: https://projects.open.iona.com/projects/svn/iona/camel/trunk/components/camel-msmq/

You'll need to register with http://open.iona.com to be able to access subversion.

The full FUSE distribution is here: https://projects.open.iona.com/projects/svn/iona/camel/trunk/

See Also

Graphic Design By Hiram