이 콘텐츠는 선택한 언어로 제공되지 않습니다.

7.2. Configuring the Type of Cursor Used by a Destination


Overview

By default, JBoss A-MQ uses store-based cursors for persistent messages and file-based cursors for non-persistent messages. You can, however, configure your destinations to use a specified cursor implementation by adding the appropriate policy entries into the destination's policy map.
You configure a destination's policy set using a destinationPolicy element. The destinationPolicy element is a wrapper for a policyMap element. The policyMap element is a wrapper for a policyEntries element. The policyEntries element is a wrapper for one or more policyEntry elements.
The cursor policies are entered as children to a policyEntry element. The configuration elements used to specify the type of destination you are configuring. Topics use cursors for both durable subscribers and transient subscribers, so it uses two sets of configuration elements. Queues only a single cursor and only require a single set of configuration elements.

Configuring topics

Topics maintain a dispatch queue and a pending cursor for every consumer subscribed to the topic regardless of whether the subscription is durable or transient. You can configure the cursor implementation used by durable subscribers separately from the cursor implementation used by transient subscribers.
You configure the cursor implementation used by durable subscribers by adding PendingDurableSubscriberMessageStoragePolicy child element to the topic's policyEntry element. Table 7.1, “Elements for Configuring the Type of Cursor to Use for Durable Subscribers” describes the possible children of PendingDurableSubscriberMessageStoragePolicy.
Table 7.1. Elements for Configuring the Type of Cursor to Use for Durable Subscribers
ElementDescription
storeDurableSubscriberCursorSpecifies that store-based cursors will be used. See the section called “Store-based cursors” for more information.
vmDurableCursor Specifies that VM cursors will be used. See the section called “VM cursors” for more information.
fileDurableSubscriberCursor Specifies that file-based cursors will be used—only suitable for non-persistent messages. See the section called “File-based cursors” for more information.
You configure the cursor implementation used by transient subscribers by adding pendingSubscriberPolicy child element to the topic's policyEntry element. Table 7.2, “Elements for Configuring the Type of Cursor to Use for Transient Subscribers” describes the possible children of pendingSubscriberPolicy.
Table 7.2. Elements for Configuring the Type of Cursor to Use for Transient Subscribers
ElementDescription
UnspecifiedDefault policy is to use store-based cursors. See the section called “Store-based cursors” for more information.
vmCursorSpecifies the VM cursors will be used. See the section called “VM cursors” for more information.
fileCursor Specifies that file-based cursors will be used. See the section called “File-based cursors” for more information.
Example 7.1, “Configuring a Topic's Cursor Usage” shows a configuration snip-it that configures a topic to use VM cursors for its transient subscribers and file-based cursors for its durable subscribers.

Example 7.1. Configuring a Topic's Cursor Usage

<beans ... >
  <broker ... >
    ...
    <destinationPolicy>
      <policyMap>
        <policyEntries>
          <policyEntry topic="com.fusesource.>" >
            ...
            <pendingSubscriberPolicy>
              <vmCursor />
            </pendingSubscriberPolicy>
            <pendingDurableSubscriberPolicy>
              <storeDurableSubscriberCursor />
            </pendingDurableSubscriberPolicy>
            ...
          </policyEntry>
          ...
        </policyEntries>
      </policyMap>
    </destinationPolicy>
    ...
  </broker>
  ...
</beans>

Configuring queues

Queues use a single pending cursor and dispatch queue. You configure the type of cursor to use by adding a pendingQueuePolicy element to the queue's policyEntry element. Table 7.3, “Elements for Configuring the Type of Cursor to Use for a Queue” describes the possible children elements of the pendingQueuePolicy element.
Table 7.3. Elements for Configuring the Type of Cursor to Use for a Queue
ElementDescription
storeCursorSpecifies that store-based cursors will be used. See the section called “Store-based cursors” for more information.
vmQueueCursorSpecifies the VM cursors will be used. See the section called “VM cursors” for more information.
fileQueueCursorSpecifies that file-based cursors will be used. See the section called “File-based cursors” for more information.
Example 7.2, “Configuring a Queue's Cursor Usage” shows a configuration snippet that configures a queue to use VM cursors.

Example 7.2. Configuring a Queue's Cursor Usage

<beans ... >
  <broker ... >
    ...
    <destinationPolicy>
      <policyMap>
        <policyEntries>
          <policyEntry queue="com.fusesource.>" >
            ...
            <pendingQueuePolicy>
              <vmQueueCursor />
            </pendingQueuePolicy>
            ...
          </policyEntry>
          ...
        </policyEntries>
      </policyMap>
    </destinationPolicy>
    ...
  </broker>
  ...
</beans>
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.