JavaSpace Component (deprecated)

Available as of Camel version 2.1

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 is also
possible to pass the bean ID of a template that can be used for
reading/taking the entries from the space.
 This component can be 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 to invoke a POJO remotely, using a JavaSpace as a
 This latter feature can provide a simple implementation of the
master/worker pattern, where a POJO provides the business logic for the
 Look at the test cases for examples of various use cases for this

Maven users will need to add the following dependency to their pom.xml for this component:

    <!-- use the same version as your Camel core version -->

URI format


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


The JavaSpace component has no options.

The JavaSpace endpoint is configured using URI syntax:


with the following path and query parameters:

Path Parameters (1 parameters):

Name Description Default Type


Required The URL to the JavaSpace server


Query Parameters (10 parameters):

Name Description Default Type

spaceName (common)

Required Specifies the JavaSpace name.


transactional (common)

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



transactionTimeout (common)

Specifies the transaction timeout in millis. By default there is no timeout.


bridgeErrorHandler (consumer)

Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.



concurrentConsumers (consumer)

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



templateId (consumer)

If present, this option specifies the Spring bean ID of the template to use for reading/taking entries.


verb (consumer)

Specifies the verb for getting JavaSpace entries.



exceptionHandler (consumer)

To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.


exchangePattern (consumer)

Sets the exchange pattern when the consumer creates an exchange.


synchronous (advanced)

Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported).



Spring Boot Auto-Configuration

When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration:

  <!-- use the same version as your Camel core version -->

The component supports 2 options, which are listed below.

Name Description Default Type


Enable javaspace component




Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders.




Sending and Receiving Entries

// sending route

// receiving Route

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

Sending and receiving serializable objects

Using the preceding routes, it is also possible to send and receive any serializable object. The JavaSpace component detects that the payload is not a Jini Entry and then it automatically wraps the payload 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 JavaSpace component has been tailored to work in combination with the Camel bean component. It is therefore possible to call a remote POJO using JavaSpace as the transport:

// client side

// server side

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