LibraryToggle FramesPrintFeedback

Configuring the Type of Cursor Used by a Destination

Overview

By default, Fuse MQ Enterprise 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 6 describes the possible children of PendingDurableSubscriberMessageStoragePolicy.

Table 6. Elements for Configuring the Type of Cursor to Use for Durable Subscribers

ElementDescription
vmDurableCursor Specifies the VM cursors will be used. See VM cursors for more information.
fileDurableSubscriberCursor Specifies that file-based cursors will be used. See 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 describes the possible children of pendingSubscriberPolicy.

Table 7. Elements for Configuring the Type of Cursor to Use for Transient Subscribers

ElementDescription
vmCursor Specifies the VM cursors will be used. See VM cursors for more information.
fileCursor Specifies that file-based cursors will be used. See File-based cursors for more information.

Example 12 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 12. Configuring a Topic's Cursor Usage

<beans ... >
  <broker ... >
    ...
    <destinationPolicy>
      <policyMap>
        <policyEntries>
          <policyEntry topic="com.fusesource.>">
            ...
            <pendingSubscriberPolicy>
              <vmCursor />
            </pendingSubscriberPolicy>
            <PendingDurableSubscriberMessageStoragePolicy>
              <fileDurableSubscriberPolicy />
            </PendingDurableSubscriberMessageStoragePolicy>
            ...
          </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 8 describes the possible children elements of the pendingQueuePolicy element.

Table 8. Elements for Configuring the Type of Cursor to Use for a Queue

ElementDescription
vmQueueCursor Specifies the VM cursors will be used. See VM cursors for more information.
fileQueueCursor Specifies that file-based cursors will be used. See File-based cursors for more information.

Example 13 shows a configuration snippet that configures a queue to use VM cursors.

Example 13. Configuring a Queue's Cursor Usage

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

Comments powered by Disqus