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.
OptaPlannerAvailable as of Camel 2.13 The optaplanner: component solves the planning problem contained in a message with OptaPlanner. The component supports consumer as BestSolutionChangedEvent listener and producer for processing Solution and ProblemFactChange Maven users will need to add the following dependency to their <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-optaplanner</artifactId> <version>x.x.x</version><!-- use the same version as your Camel core version --> </dependency> URI formatoptaplanner:solverConfig[?options] The solverConfig is the classpath-local URI of the solverConfig, for example You can append query options to the URI in the following format, URI Options (since v 2.16)
Message Headers (since v 2.16)
Message BodyCamel takes the planning problem for the IN body, solves it and returns it on the OUT body.
TerminationThe solving will take as long as specified in the <solver> ... <termination> <!-- Terminate after 10 seconds, unless it's not feasible by then yet --> <terminationCompositionStyle>AND</terminationCompositionStyle> <secondsSpentLimit>10</secondsSpentLimit> <bestScoreLimit>-1hard/0soft</bestScoreLimit> </termination> ... <solver>
SamplesSolve an planning problem that's on the ActiveMQ queue with OptaPlanner: from("activemq:My.Queue"). .to("optaplanner:/org/foo/barSolverConfig.xml"); Expose OptaPlanner as a REST service: from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer") .to("optaplanner:/org/foo/barSolverConfig.xml"); |