Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Copy edits and updated Fuse Maven details

JavaSpace Component

The javaspace: component is a transport for working with any JavaSpace compliant implementation , and this component has been tested with both the Blitz implementation and the GigaSpace implementation .
This component can be used for sending and receiving any object inheriting from the Jini net.jini.core.entry.Entry class, it's . It is also possible to pass an id (Spring Bean) the bean ID of a template that can be used for reading/taking the entries from the space.
This component can be also used for sending/receiving any serializable object acting as a sort of generic transport. The JavaSpace component contains a special optimization for dealing with the BeanExchange. It can be used , then, for invoking remotely to invoke a POJO remotely, using a JavaSpace as a transport a JavaSpace.
This latter feature can be used for an easy provide a simple implementation of the master/worker pattern, where a POJO provides the business logic for the worker.
Look at the test cases for seeing the various usage option examples of various use cases for this component.

URI format

Code Block
javaspace:jini://host[?options]

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

Examples

Sending and Receiving Entries

...

In this case the payload can be any object inheriting that inherits from the Jini Entry type.

Sending and receiving serializable objects

Using the preceding routes as above , it 's is also possible to send and receive any serializable object. The camel JavaSpace component detects that the payload is not a Jini Entry and then it automatically wraps the payload into with a Camel Jini Entry. In this way, a JavaSpace can be used as a generic transport mechanism.

Using JavaSpace as a remote invocation transport

The camel-javaspace JavaSpace component has been tailored to work in combination with the camel-Camel bean component. It 's possible, then, is therefore possible to call a remote POJO using JavaSpace as a the transport:

No Format
from("direct:input").to("javaspace:jini://localhost?spaceName=mySpace"); //Client side

from("javaspace:jini://localhost?concurrentConsumers=10&spaceName=mySpace").to("pojo:pojo"); //Server side

In the code there are two test cases showing how to use the a POJO for realizing to realize the master/worker pattern. The idea is to use the POJO for providing to provide the business logic and relying rely on camel Camel for sending/receiving requests/replies with the proper correlation.

...

Name

Default Value

Description

spaceName

null

This is Specifies the JavaSpace name.

verb

take

This is Specifies the verb for getting JavaSpace entries, it . The values can be: take or read.

transactional

false

if If true, sending and receiving of entries is performed under within a transaction.

transactionalTimeout

Long.MAX_VALUE

Specifies the transaction timeout.

concurrentConsumers

1

Specifies the number of concurrent consumer consumers getting entries from the JavaSpace.

templateId

null

if If present, this option it's a Spring Bean id to be used as a template specifies the Spring bean ID of the template to use for reading/taking entries.

Using camel-javaspace

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

Code Block
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-parent</artifactId>
  <version>1.46.01.02-fuse</version>
</dependency>

And ensure Make sure that you are pointing at the maven reporight Maven repository:

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

Building

...

from source

The source for camel-javaspace is available hereat: httpshttp://projects.open.ionafusesource.com/projectsforge/svn/ionafuseeip/camel/trunk/components/camel-javaspace/Image Modified

You 'll need to register with http://open.ionafusesource.comImage Modified to be able to access subversion.

The full FUSE distro is hereavailable from: httpshttp://projects.open.ionafusesource.com/projects/svn/iona/camel/trunkproducts/enterprise-camel/Image Modified

Include Page
CAMEL:Endpoint See Also
CAMEL:Endpoint See Also