The BlazeDS MessageService
has traditionally been configured by the inclusion of a messaging-config.xml file in the BlazeDS XML configuration.
When using only Spring-managed message destinations, this config file can be left out completely as the inclusion of the message-broker
tag
in your Spring configuration will cause the MessageService
to be configured with sensible defaults if none already exists at startup
time. The end result is essentially equivalent to including the following minimal messaging-config.xml in your BlazeDS configuration:
<?xml version="1.0" encoding="UTF-8"?> <service id="remoting-service" class="flex.messaging.services.MessageService"> <adapters> <adapter-definition id="actionscript" class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" default="true"/> </adapters> <default-channels> <channel ref="my-polling-amf"/> </default-channels> </service>
Note that this assumes that there is already an equivalent application-wide default-channels
configuration. It is recommended that
you set the desired service-specific channels (see example below) if not relying on an application-wide default setup. If no application-wide
defaults exist, a best guess will be made by configuring the first available channel from the MessageBroker
that uses an
AMFEndpoint
with polling enabled as the default for the MessageService
.
If you wish to have more explicit control over the defaults that will be set on the MessageService
, you can customize them
via the message-service
child element of the message-broker
tag. For example:
<flex:message-broker> <flex:message-service default-adapter-id="my-default-messaging-adapter" default-channels="my-polling-amf" /> </flex:message-broker>
If you have an existing messaging-config.xml for a legacy BlazeDS application, the MessageDestinationFactory
will be able to work transparently
with it, allowing you to gradually migrate to all Spring-managed messaging destinations.