Mule : Configuring Endpoints
This page last changed on Jun 02, 2006 by stephen fenech.
Endpoints in Mule are used to communitcate with other applications or mule instances. They are like message gateways through which events can be sent and received for more information see Mule Endpoints. ConfigurationEndpoints can be configured on Exception Strategies, routers and catch-all strategies. The <endpoint> elements represents the org.mule.umo.endpoint.UMOEndpoint class. <mule-descriptor name="test" implementation="org.foo. MyComponent"> <inbound-router> <endpoint address="jms://my.queue"/> </inbound-router> <outbound-router> <router classname="org.mule.routing.outbound.OutboundPassThroughRouter"> <endpoint address="smtp://[email protected]"/> </router> </outbound-router> </mule-descriptor> The most simple endpoint configuration just needs to provide an address. For more information about configuring components go here. Attributes on the endpoint element are -
FiltersA filter can be configured on an endpoint to filter inbound messages. The filter can be transport specific such as a Jms selector or file filter or can be a general filter such as using JXPath to filter on email messages. Filtering is not supported by all transports and setting a filter on an endpoint using some transports will result in an UnsupportedOperationException. See the Transports Guide for more information about filtering on a particular transport. TransactionsThransaction element can be configured between two endpoints where the event processing between each is synchronous, this is controlled by setting the synchrous property on the connectors for each of the endpoints. For more information about configuring transactions go here. PropertiesProperties on endpoints can be used to customise behaviour for a particular endpoint instance. Any properties set on the endpoint can be used to overload properties on the connector. An example of this would be having an Smtp outbound endpoint and setting the fromAddress. See Configuring Properties for more information about how various property types can be used. Global EndpointsGlobal endpoints are configured Endpoints that are registered with the MuleManager. This means any object in Mule can make use of these endpoints. When you reference a global endpoint Mule actually returns a clone of the Endpoint. This allows client code to change any attibutes on the endpoint without affecting other objects in the system that also use the endpoint. <mule-configuration> <global-endpoints> <endpoint name="ExceptionQueue" address="jms://exception.queue"/> <global-endpoints> .... <mule-configuration> A clone of this endpoint can be obtained in code using - UMOEndpoint endpoint = MuleManager.getInstance().lookupEndpoint("ExceptionQueue");
To reference a global endpoint in the configuration you use the <global-endpoint> element. The only attibutes that can be set on this element are -
You can also set properties, transactions and filters on the referenced endpoint and these will override the values set on the global endpoint. <mule-descriptor name="test" implementation="org.foo. MyComponent"> <outbound-router> <catch-all-strategy className="org.mule.routing.inbound.ForwardingCatchAllStrategy"> <global-endpoint name="ExceptionQueue"/> </catch-all-strategy> <router classname="org.mule.routing.outbound.OutboundPassthroughRouter"> <endpoint address="smtp://[email protected]"/> </router> </outbound-router> </mule-descriptor> Endpoint IdentifiersEndpoint identifiers can be used to map logical names to endpoint URIs. These identifiers can be used in place of the actual URI in the configuration and in code. This allows you to define all your endpoint URIs in one location which can be very useful when you move Mule instances between environments. <mule-configuration> <endpoint-identifiers> <endpoint-identifier name="Component1Inbound" value="jms://in.queue"/> <endpoint-identifier name="Component1Outbound" value="jms://out.queue"/> <endpoint-identifiers> <model> <mule-descriptor name="Component1" inboundEndpoint="Component1Inbound" outboundEndpoint="Component1Outbound" implementation="com.foo.Component"> </mule-descriptor> </model> <mule-configuration> |
Document generated by Confluence on Nov 27, 2006 10:27 |