Share via


ServiceBusRuleManagerClient クラス

  • java.lang.Object
    • com.azure.messaging.servicebus.ServiceBusRuleManagerClient

実装

public class ServiceBusRuleManagerClient
implements AutoCloseable

特定のトピック サブスクリプションのルールを管理する 同期 ルール マネージャー。 ルール マネージャーではリッスン要求のみが必要ですが、 には要求の管理が ServiceBusAdministrationAsyncClient 必要です。

Service Bus サブスクリプションに対するルールを作成する

TokenCredential credential = new DefaultAzureCredentialBuilder().build();

 // 'fullyQualifiedNamespace' will look similar to "{your-namespace}.servicebus.windows.net"
 ServiceBusRuleManagerClient ruleManager = new ServiceBusClientBuilder()
     .credential(fullyQualifiedNamespace, credential)
     .ruleManager()
     .topicName(topicName)
     .subscriptionName(subscriptionName)
     .buildClient();

 RuleFilter trueRuleFilter = new TrueRuleFilter();
 CreateRuleOptions options = new CreateRuleOptions(trueRuleFilter);
 ruleManager.createRule("new-rule", options);

 // Dispose of the ruleManager when finished using it.
 ruleManager.close();

メソッドの概要

修飾子と型 メソッドと説明
void close()

を破棄します ServiceBusRuleManagerClient

void createRule(String ruleName, CreateRuleOptions options)

現在のサブスクリプションに対して、トピックからサブスクリプションに到達するメッセージをフィルター処理するルールを作成します。

void deleteRule(String ruleName)

によって識別されるサブスクリプションの規則を ruleName削除します。

String getEntityPath()

Service Bus リソースの名前を取得します。

String getFullyQualifiedNamespace()

完全修飾名前空間を取得します。

IterableStream<RuleProperties> listRules()

トピックとサブスクリプションに関連付けられているすべてのルールをフェッチします。

メソッドの継承元: java.lang.Object

メソッドの詳細

close

public void close()

を破棄します ServiceBusRuleManagerClient。 クライアントに専用接続がある場合は、基になる接続も閉じられます。

createRule

public void createRule(String ruleName, CreateRuleOptions options)

現在のサブスクリプションに対して、トピックからサブスクリプションに到達するメッセージをフィルター処理するルールを作成します。

Parameters:

ruleName - ルールの名前。
options - 追加するルールのオプション。

deleteRule

public void deleteRule(String ruleName)

によって識別されるサブスクリプションの規則を ruleName削除します。

Parameters:

ruleName - 削除するルールの名前。

getEntityPath

public String getEntityPath()

Service Bus リソースの名前を取得します。

Returns:

Service Bus リソースの名前。

getFullyQualifiedNamespace

public String getFullyQualifiedNamespace()

完全修飾名前空間を取得します。

Returns:

完全修飾名前空間。

listRules

public IterableStream listRules()

トピックとサブスクリプションに関連付けられているすべてのルールをフェッチします。

Returns:

トピックとサブスクリプションに関連付けられているルールの一覧。

適用対象