| Namespace | http://www.mulesoft.org/schema/mule/odata |
|---|---|
| Schema Location | http://www.mulesoft.org/schema/mule/odata/current/mule-odata.xsd (View Schema) |
| Schema Version | 1.0 |
| Minimum Mule Version | 3.4 |
Connector for consuming OData feeds by performing read, create, update and delete operations. Bath operations are also supported. This version of the connector does not use any kind of authentication.
| Configuration | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Configure an instance of this module
| |||||||||||
| Message Processors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Executes a series of insert/update/deletes in a batch grouped in one changeset.
| |||||||||||
Inserts an entity from an input pojo.
| |||||||||||
Reads entities from an specified set and returns it as a list of pojos.
| |||||||||||
To use the this module within a flow the namespace to the module must be included. The resulting flow will look similar to the following:
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:odata="http://www.mulesoft.org/schema/mule/odata"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/odata
http://www.mulesoft.org/schema/mule/odata/current/mule-odata.xsd">
<!-- here goes your flows and configuration elements -->
</mule>
This module is configured using the config element. This element must be placed outside of your flows and at the root of your Mule application. You can create as many configurations as you deem necessary as long as each carries its own name.
Each message processor, message source or transformer carries a config-ref attribute that allows the invoker to specify which configuration to use.
| Attributes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | Name | Default Value | Description | Java Type | MIME Type | Encoding | Optional. Give a name to this configuration so it can be later referenced. | ||||
Optional. An instance of ODataConsumerFactory
to intanciate the ODataConsumer. |
|||||||||||
| V2 | Optional. The protocol version to be used when consuming external services | ||||||||||
| JSON | Optional. The format of the payload to be used during communication. | ||||||||||
| LOWER_CAMEL_CASE | Optional. The namig policy to be used when mapping pojo's attributes to OData entities. | ||||||||||
This connector offers automatic connection management via the use of a connection pool. The pool will act a storage mechanism for all the connections that are in-use by the user of this connector.
Prior to execution of a processor, the connector will attempt to lookup an already established connection and if one doesn't exists it will create one. That lookup mechanism is done in the connection pool via the use of connection variables declared as keys.
The user of the connector can configure the pool by adding a connection-pooling-profile to the connector configuration like this:
<odata:connection-pooling-profile maxActive="10" maxIdle="10"
exhaustedAction="WHEN_EXHAUSTED_GROW" maxWait="120" minEvictionMillis="60000" evictionCheckIntervalMillis="30000"/>
The following is a list of connection attributes, each connection attribute can be configured at the config element level or they can also be added to each processor. If they are used at the processor level they get the benefit of full expression resolution.
| Connection Attributes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
| Optional. Specify which configuration to use. | |||||||||||
| The authorization username | String | */* | UTF-8 | ||||||||
| The authorization password | String | */* | UTF-8 | ||||||||
| The URI of the target OData Service | String | */* | UTF-8 | ||||||||
Reconnection Strategies specify how a connector behaves when its connection fails. You can control how Mule attempts to reconnect by specifying a number of criteria:
With a reconnection strategy, you can better control the behavior of a failed connection, by configuring it, for example, to re-attempt the connection only once every 15 minutes, and to give up after 30 attempts. You can also send an automatic notification to your IT administrator whenever this reconnection strategy goes into effect. You can even define a strategy that attempts to reconnect only during business hours. Such a setting can prove useful if your server is frequently shut down for nightly maintenance.
A reconnection strategy that allows the user to configure how many times a reconnection should be attempted and how long to wait between attempts.
<odata:config>
<reconnect count="5" frequency="1000"/>
</odata:config>
| Reconnect Attributes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Name | Default Value | Description | |||||||||
| Optional. How often (in ms) to reconnect | |||||||||||
| Optional. How many reconnection attempts to make | |||||||||||
For more information about reconnection strategies in Mule, or even how to write your own custom reconnection strategy please check this section.
Executes a series of insert/update/deletes in a batch grouped in one changeset.
INCLUDE_ERROR
| Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Optional. Specify which configuration to use. | |||||||||||
| The current mule message | MuleMessage | */* | |||||||||
| Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
| Optional. The authorization username | String | */* | UTF-8 | ||||||||
| Optional. The authorization password | String | */* | UTF-8 | ||||||||
| Optional. The URI of the target OData Service | String | */* | UTF-8 | ||||||||
| Name | Default Value | Description | Java Type |
|---|---|---|---|
| Nested processors where each individual operation is to be performed | List<NestedProcessor> |
| Return Type | Description |
|---|---|
| BatchResult | an instance of BatchResult
|
Inserts an entity from an input pojo.
To specify the entitie's id, your pojo can rather have an attribute of type
Guid or to have a string attribute annotated with Guid
INCLUDE_ERROR
| Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Optional. Specify which configuration to use. | |||||||||||
| The current mule message | MuleMessage | */* | |||||||||
| #[payload] | Optional. An object representing the entity | Object | */* | ||||||||
| Optional. The name of the set. If not specified then it's inferred by adding the suffix 'Set' to the objects simple class name | String | */* | UTF-8 | ||||||||
| Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
| Optional. The authorization username | String | */* | UTF-8 | ||||||||
| Optional. The authorization password | String | */* | UTF-8 | ||||||||
| Optional. The URI of the target OData Service | String | */* | UTF-8 | ||||||||
Deletes an entity represented by a pojo on the OData service
To specify the entitie's id, your pojo can rather have an attribute of type
Guid or to have a string attribute annotated with Guid
INCLUDE_ERROR
| Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Optional. Specify which configuration to use. | |||||||||||
| The current mule message | MuleMessage | */* | |||||||||
| #[payload] | Optional. An object representing the entity | Object | */* | ||||||||
| Optional. The name of the set. If not specified then it's inferred by adding the suffix 'Set' to the objects simple class name | String | */* | UTF-8 | ||||||||
| The name of the pojo's attribute that holds the entity's key. The attribute cannot hold a null value | String | */* | UTF-8 | ||||||||
| Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
| Optional. The authorization username | String | */* | UTF-8 | ||||||||
| Optional. The authorization password | String | */* | UTF-8 | ||||||||
| Optional. The URI of the target OData Service | String | */* | UTF-8 | ||||||||
Reads entities from an specified set and returns it as a list of pojos. You can optionally provide a returnClass parameter which will allow you to get the result as a list of pojos (as long as that class is compliant with the Bean contract). If you don't specify it, you'll get a list of generic ${org.odata4j.core.OEntity} objects.
INCLUDE_ERROR
| Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Optional. Specify which configuration to use. | |||||||||||
| org.odata4j.core.OEntity | Optional. The canonical class name for the pojo instances to be returned. If none especified then generic OEntity class will be returned. OEntity is a pojo which represents the set's metadata and allows for browsing | String | */* | UTF-8 | |||||||
| The name of the set to be read | String | */* | UTF-8 | ||||||||
| Optional. An OData filtering expression. If not provided, no filtering occurs (see http://www.odata.org/developers/protocols/uri-conventions#FilterSystemQueryOption) | String | */* | UTF-8 | ||||||||
| Optional. The ordering expression. If not provided, no ordering occurs (see http://www.odata.org/developers/protocols/uri-conventions#OrderBySystemQueryOption( | String | */* | UTF-8 | ||||||||
| Optional. Sets the expand expressions. | String | */* | UTF-8 | ||||||||
| Optional. Number of items to skip, usefull for pagination. If not provided, no records are skept (see http://www.odata.org/developers/protocols/uri-conventions#SkipSystemQueryOption) | Integer | */* | |||||||||
| Optional. Number of items to return (see http://www.odata.org/developers/protocols/uri-conventions#TopSystemQueryOption) | Integer | */* | |||||||||
| Optional. The selection clauses. If not specified, all fields are returned (see http://www.odata.org/developers/protocols/uri-conventions#SelectSystemQueryOption) | String | */* | UTF-8 | ||||||||
| Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
| Optional. The authorization username | String | */* | UTF-8 | ||||||||
| Optional. The authorization password | String | */* | UTF-8 | ||||||||
| Optional. The URI of the target OData Service | String | */* | UTF-8 | ||||||||
| Return Type | Description |
|---|---|
| List<Object> | a list of objects of class "returnClass" representing the obtained entities |
Updates an entity represented by a pojo on the OData service
To specify the entitie's id, your pojo can rather have an attribute of type
Guid or to have a string attribute annotated with Guid
INCLUDE_ERROR
| Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Optional. Specify which configuration to use. | |||||||||||
| The current mule message | MuleMessage | */* | |||||||||
| #[payload] | Optional. An object representing the entity | Object | */* | ||||||||
| Optional. The name of the set. If not specified then it's inferred by adding the suffix 'Set' to the objects simple class name | String | */* | UTF-8 | ||||||||
| The name of the pojo's attribute that holds the entity's key. The attribute cannot hold a null value | String | */* | UTF-8 | ||||||||
| Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
| Optional. The authorization username | String | */* | UTF-8 | ||||||||
| Optional. The authorization password | String | */* | UTF-8 | ||||||||
| Optional. The URI of the target OData Service | String | */* | UTF-8 | ||||||||