Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.
JavaSpace ComponentAvailable as of Camel 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 . Maven users will need to add the following dependency to their <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-javaspace</artifactId> <version>x.x.x</version> <!-- use the same version as your Camel core version --> </dependency> URI formatjavaspace:jini://host[?options] You can append query options to the URI in the following format, Options
ExamplesSending and Receiving Entries// sending route from("direct:input") .to("javaspace:jini://localhost?spaceName=mySpace"); // receiving Route from("javaspace:jini://localhost?spaceName=mySpace&templateId=template&verb=take&concurrentConsumers=1") .to("mock:foo"); In this case the payload can be any object that inherits from the Jini Sending and receiving serializable objectsUsing 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 Using JavaSpace as a remote invocation transportThe 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 from("direct:input") .to("javaspace:jini://localhost?spaceName=mySpace"); // server side from("javaspace:jini://localhost?concurrentConsumers=10&spaceName=mySpace") .to("mock:foo"); 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. |