LibraryToggle FramesPrintFeedback

Consumer configuration

Overview

The JMS consumer configuration allows you to specify the following:

  • the type of message.

  • the number of milliseconds the consumer will wait for a response.

  • the number of milliseconds a request will exist before the JMS broker can remove it.

Configuration elements

Consumer endpoint configuration is specified using the jms:conduit element. It has two children:

  • jms:runtimePolicy—configures the JMS message type

  • jms:clientConfig—configures the response timeout and the message's time to live

Specifying the message type

The jms:runtimePolicy element specifies the message type supported by the consumer endpoint using . The message type is specified using the messageType attribute. The messageType attribute has two possible values:

Table 20. messageType values

textSpecifies that the data will be packaged as a TextMessage.
binaryspecifies that the data will be packaged as an ByteMessage.

jms:clientConfig

The jms:clientConfig element two attributes that are used to specify the configurable runtime properties of a consumer endpoint:

clientReceiveTimeout

The clientReceiveTimeout attribute specifies the interval, in milliseconds, a consumer endpoint will wait for a response before timing out. The default timeout interval is 2000.

messageTimeToLive

The messageTimeToLive attribute specifies the interval, in milliseconds, that a request can remain unreceived before the JMS broker can delete it. The default time to live interval is 0 which specifies that the request has an infinite time to live.

Example

Example 66 shows a configuration entry for configuring a JMS consumer endpoint.

Example 66. Configuration for a JMS Consumer Endpoint

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:ct="http://cxf.apache.org/configuration/types"
       xmlns:jms="http://cxf.apache.org/transports/jms"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                             http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://cxf.apache.org/jaxws
                             http://cxf.apache.org/schemas/jaxws.xsd
                           http://cxf.apache.org/transports/jms
                             http://cxf.apache.org/schemas/configuration/jms.xsd">
   ...
  <jms:conduit name="{http://cxf.apache.org/jms_endpt}HelloWorldJMSPort.jms-conduit">
    <jms:address ... >
                    ...
    </jms:address>
                    ...
    <jms:runtimePolicy messageType="binary"/>
    <jms:clientConfig clientReceiveTimeout="500"
                      messageTimeToLive="500" />
  </jms:conduit>
  ...
</beans>

Comments powered by Disqus