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

Chapter 8. Message Store Lockers


Abstract

Message store locks are used to elect the master broker in master/slave groups. They are also useful for ensuring that multiple brokers are not attempting to share the same message store. Red Hat JBoss A-MQ's lockers are configurable to allow for tuning.

8.1. Locker Basics

Overview

Red Hat JBoss A-MQ provides two default lockers that are used based on the type of message store being used:
  • shared file locker—used by KahaDB and LevelDB stores
  • database locker—used by the JDBC store
    Note
    JBoss A-MQ also provides a leased database locker that can be in cases where the brokers may periodically lose their connection to the message store.
These default lockers are configurable to optimize their performance.
For further optimization, you can implement your own locker and plug it into the message store. Doing so involves implementing a simple Java interface and adding some configuration to the persistence adapter.
Message store locks are primarily leveraged by the broker for electing masters in master/slave configurations. For more information on master/slave groups see chapter "Master/Slave" in "Fault Tolerant Messaging".

Configuring a persistence adapter's locker

To configure the locker used by a persistence adapter you add a locker element as a child to the adapter's configuration element as shown in Example 8.1, “Configuring a Message Store Locker”.

Example 8.1. Configuring a Message Store Locker

<persistenceAdapter>
  <kahaDB directory = "target/activemq-data">
    <locker>
      ...
    </locker>
  </kahaDB>
</persistenceAdapter>

Standard locker configuration properties

All locker implementations are required to have the two common configuration properties described in Table 8.1, “Common Locker Properties”.
Table 8.1. Common Locker Properties
PropertyDefault ValueDescription
lockAcquireSleepInterval 1000Specifies the delay interval, in milliseconds, between attempts to acquire a lock.
failIfLocked falseSpecifies in the broker should immediately fail if a lock cannot be obtained.
The properties are specified as attributes to the locker's XML configuration element.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

© 2024 Red Hat, Inc.