Understanding Message Service configuration

The most common tasks that you perform when configuring the Message Service are defining message destinations, applying security to message destinations, and modifying logging settings. A Message Service destination is the server-side code that you connect to using Producer and Consumer components. You configure Message Service destinations in the Message Service section of the Flex services configuration file or a file that it includes by reference. By default, the Flex services configuration file is named services-config.xml and is located in the WEB_INF/flex directory of the web application that contains Adobe Flex Data Services. In the Flex service configuration files that Adobe ships, individual configuration files for Flex Data Services, the Flex Message Service, and remote procedure call (RPC) services are usually referenced.

The following example shows a basic Message Service configuration in the Flex services configuration file. It contains one destination that is configured for a chat application that uses the default message adapter, which in this example is the ActionScript adapter.

...
<service id="message-service"
    class="flex.messaging.services.MessageService"
    messageTypes="flex.messaging.messages.AsyncMessage">
    <adapters>
        <adapter-definition id="actionscript"
        class="flex.messaging.services.messaging.
            adapters.ActionScriptAdapter" default="true"/>
        <adapter-definition id="jms"
            class="flex.messaging.services.messaging.adapters.JMSAdapter"/>
    </adapters>
...
    <destination id="chat-topic">
        <properties>
            <network>
                <session-timeout>0</session-timeout>
                <throttle-inbound policy="ERROR" max-frequency="50"/>
                <throttle-outbound policy="REPLACE" max-frequency="500"/>
            </network>
            <server>
                <max-cache-size>1000</max-cache-size>
                <message-time-to-live>0</message-time-to-live>
                <durable>true</durable>
                <durable-store-manager>
                    flex.messaging.durability.FileStoreManager
                </durable-store-manager>
            </server>
        </properties>
        <channels>
            <channel ref="samples-rtmp"/>
            <channel ref="samples-amf-polling"/>
        </channels>
    </destination>
...
</service>
...

Subtopics

Message Service destinations
Message channels
Message Service adapters
Security

Message Service destinations

When you define a destination, you reference one or more message channels that transport messages. You also reference a message adapter or use an adapter that is configured as the default adapter. The ActionScript adapter lets you use messaging with Flex clients as the sole producers and consumers of the messages. The Java Message Service (JMS) message adapter lets you interact with a Java Message Service (JMS) implementation. For more information, see Message Service adapters.

You also set network- and server-related properties. You can also reference or define security constraints for a destination. For more information, see Configuring Message Service destinations.

Message channels

A destination references one or more message channels, which are defined in the services-config.xml configuration file. The two most common channels that you use for messaging are the Realtime Message Protocol (RTMP) channel and the Action Message Format (AMF) channel with message polling enabled.

The RTMP channel maintains a connection between the client and the server, so the client does not need to poll the server. The AMF channel with polling enabled polls the server for new messages.

For more information about securing messaging channels, see Securing destinations.

Message Service adapters

A Message Service adapter is the server-side code that facilitates messaging when your application uses ActionScript objects only or interacts with another system, such as an implementation of the Java Message Service (JMS). You reference adapters in a destination definition. You can also specify adapter-specific settings. For more information about message adapters, see Configuring Message Service destinations.

Security

One way to secure a destination is by using a security constraint, which defines the access privileges for the destination.

You use a security constraint to authenticate and authorize users before allowing them to access a destination. You can specify whether to use basic or custom authentication, and indicate the roles required for authorization.

You can declare a security constraint inline in a destination definition, or you can declare it globally and reference it by its id in a destination definitions.

For more information about security, see Securing destinations.


Flex 2.01

Take a survey