JBI Support deprecated in Apache ServiceMix 4

JBI 1.0 support is available in Apache ServiceMix 4 to allow existing users to migrate more easily to this latest version - if you're a new user, you should consider JBI deprecated and not use it for your project. Take a look at our technology selection guidelines for more information.

servicemix-scripting

Overview

The ServiceMix Scripting component provides support for processing scripts using JSR-223 compliant scripting languages.

The component is currently shipping with:

  • Groovy (1.5.6)

  • JRuby (1.1.2)

  • Rhino JavaScript (1.7R1)

Namespace and xbean.xml

The namespace URI for the servicemix-bean JBI component is http://servicemix.apache.org/scripting/1.0. This is an example of an xbean.xml file with a namespace definition with prefix bean.

<beans xmlns:scripting="http://servicemix.apache.org/scripting/1.0">

  <!-- add scripting:endpoint here -->

</beans>

Endpoint types

The servicemix-scripting component defines a single endpoint type:

  • scripting:endpoint :: The scripting endpoint can be used to use scripts to handle exchanges or send new exchanges

scripting:endpoint

Endpoint properties

Property Name Type Description
bindings java.util.Map A Map with additional variables that are made available during script execution.
copyAttachments boolean Copy the attachments into the 'out' message. Defaults to <code>true</code>.
copyProperties boolean Copy the properties into the 'out' message. Defaults to <code>true</code>.
disableOutput boolean Set this flag to true to <code>true</code> to avoid sending back a response message. Defaults to <code>false</code>
endpoint java.lang.String <p> Get the endpoint implementation. </p>
interfaceName javax.xml.namespace.QName <p> Get the qualified name of the endpoint interface. </p>
language java.lang.String The scripting language to be used. Defaults to <code>autodetect</code> to determine the language by the script file extension.
logResourceBundle java.lang.String The resource bundle to use when logging internationalized messages.
marshaler org.apache.servicemix.scripting.ScriptingMarshalerSupport Custom marshaler implementation to handle startup/shutdown, loading the script code and registering additional user beans.
script org.springframework.core.io.Resource Spring Resource referring to the script location.
scriptLogger java.util.logging.Logger returns the script logger
service javax.xml.namespace.QName <p> Get the service qualified name of the endpoint. </p>
targetEndpoint java.lang.String Target endpoint for the output exchange that is created by the script.
targetInterface javax.xml.namespace.QName Target interface for the output exchange that is created by the script.
targetOperation javax.xml.namespace.QName Target operation for the output exchange that is created by the script.
targetService javax.xml.namespace.QName Target service for the output exchange that is created by the script.
targetUri java.lang.String URI for configuring target service/endpoint/interface for the exchange that is created by the script.