I’m using Spring DSL, apache camel 2.10 and trying to create a route that calls a php script.
<route id="HTTPtoJMS">
<from uri="jetty:http://0.0.0.0:8888/placeorder" />
<inOnly uri="jms:incomingOrders" />
<to uri="language:php:/home/rosh/test/getAllBills.php" />
</route>
I start it as a war in apache tomcat 7, and the webapp starts without exceptions.
However, at runtime, I get :
java.lang.IllegalArgumentException: No script engine could be created for: php
What am I doing wrong?
I browsed the very few resources on how to call php from spring dsl, such as http://camel.apache.org/book-languages-appendix.html , but couldn’t find what i am doing wrong.
I have in my pom.xml the dependency for scripting languages.
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-script</artifactId>
<version>${camel.version}</version>
</dependency>
Thanks.
The camel-script component uses the Java Scripting API. And you would need to install a PHP Scripting Engine in your JVM to support this. There is a few that comes out of the box with the JVM, I think one such is JavaScript.