---
schema_version: "1"
id: 3f2550cc080a77dc76e6a7f3e45a187db110022cf2a9ad5b4f745b9d401b58f3
title: Anypoint MQ Connector のアップグレードおよび移行
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/anypoint-mq-connector/latest/anypoint-mq-connector-upgrade-migrate.md
canonical_url: https://docs.mulesoft.com/jp/anypoint-mq-connector/latest/anypoint-mq-connector-upgrade-migrate
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 0d54619b9524ac17c4e13264d2219471391233695b03a78cbe76cc91f96faf8a
description: MuleSoft Documentation Site
release: 4.x
latest: true
---
# Anypoint MQ Connector のアップグレードおよび移行

最新の機能を使用するには、Anypoint MQ 用 Anypoint Connector (Anypoint MQ Connector) をバージョン 3.x からバージョン 4.x にアップグレードします。

## [](#サポートされているアップグレードパス)サポートされているアップグレードパス

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">開始バージョン</th>
<th class="tableblock halign-left valign-top">終了バージョン</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>3.x</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>4.x</p>
</div></div></td>
</tr>
</tbody>
</table>

## [](#このリリースでの変更)このリリースでの変更

バージョン 4.x に含まれる一部の変更により、バージョン 3.x との後方互換性が失われます。

Anypoint MQ Connector 4.x には、次の機能のサポートが含まれています。

- クロスリージョンフェールオーバー
    
    Mule 4 用 Anypoint MQ Connector バージョン 4.0.7 以降では、標準キューのフェールオーバー機能が提供されます。
    
    有効にすると、Mule アプリケーションがリージョン内の Anypoint MQ サーバーにアクセスできない場合、コネクタは代替リージョンの代替キューに切り替えて、メッセージをパブリッシュおよびコンシュームします。
    
    詳細は、以下を参照してください。
    
    - [mq::mq-failover.adoc](#mq::mq-failover.adoc)
    - [アプリケーションでのクロスリージョンフェールオーバーの設定](https://docs.mulesoft.com/jp/anypoint-mq-connector/latest/anypoint-mq-failover)
- 接続アプリケーション
    
    Mule 4 用 Anypoint MQ Connector バージョン 4.0.1 以降には、​**\[Global Element Properties (グローバル要素のプロパティ)\]**​ ページの ​**\[URL\]**​ 項目の新しい形式が含まれています。
    
    - Anypoint MQ Connector 3.x では、URL は次の形式でした。
        
        `https://mq-us-east-1.anypoint.mulesoft.com/api/v1`
    - Anypoint MQ Connector 4.x では、URL 形式に ​`{orgID}`​ と ​`{envID}`​ が含まれます。次に例を示します。
        
        `https://mq-us-east-1.anypoint.mulesoft.com/api/v1/organizations/{orgID}/environments/{envID}`
    
    <table>
<tbody><tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
<div class="paragraph">
<p>誤ったバージョンの URL を使用してコネクタを設定すると、
Anypoint MQ は次のエラーを返します。</p>
</div>
<div class="paragraph">
<p><code>Invalid api url provided</code>​ (無効な API URL が指定されています)</p>
</div>
</td>
</tr>
</tbody></table>

フェールオーバー機能を使用するには、[アプリケーションでのクロスリージョンフェールオーバーの設定](https://docs.mulesoft.com/jp/anypoint-mq-connector/latest/anypoint-mq-failover)を参照してください。

## [](#アップグレード前提条件)アップグレード前提条件

アップグレードを実行する前に、以前のバージョンに復元する必要がある場合に備えて、ファイル、データ、および設定のバックアップを作成します。

## [](#アップグレード手順)アップグレード手順

Anypoint MQ Connector 4.x にアップグレードする手順は、次のとおりです。

1. Anypoint MQ の ​**\[Destinations (宛先)\]**​ ページで、​**\[Copy (コピー)\]**​ をクリックし、メニューから ​**\[Connector version 4.x and later (Connector バージョン 4.x 以降)\]**​ を選択します。
    
    ![\[Copy (コピー)\] ボタンとコネクタバージョンオプションを含むメニュー](../../mq/_images/mq-tutorial-url.png)
2. Anypoint Studio で、Mule プロジェクトを開きます。
3. \[Mule Palette (Mule パレット)\] ビューで、​**\[Search in Exchange (Exchange 内を検索)\]**​ をクリックします。
4. **\[Add Dependencies to Project (連動関係をプロジェクトに追加)\]**​ で、検索項目に「​`Anypoint MQ`​」と入力します。
5. **\[Available modules (使用可能なモジュール)\]**​ で ​**\[Anypoint MQ Connector - Mule 4\]**​ を選択し、​**\[Add (追加)\]**​ をクリックします。
6. **\[Finish (完了)\]**​ をクリックします。
    
    Anypoint Studio はコネクタを自動的にアップグレードします。
7. `pom.xml`​ ファイルで ​`mq-connector`​ 連動関係のバージョンが ​`4.0.5`​ 以降であることを確認します。
    
    ```xml
    <dependency>
    	<groupId>com.mulesoft.connectors</groupId>
    	<artifactId>anypoint-mq-connector</artifactId>
    	<version>4.0.5</version>
    	<classifier>mule-plugin</classifier>
    </dependency>
    ```
8. Anypoint Studio の ​**\[Anypoint MQ Config (Anypoint MQ 設定)\]**​ ウィンドウで、​**\[URL\]**​ 項目に URL を貼り付けます。
    
    ![URL、クライアントアプリケーション ID、クライアントシークレットが表示されている \[Anypoint MQ Config (Anypoint MQ 設定)\] ページ](../../mq/_images/mq-tutorial-studio7-mq-config.png)
9. 認証方法に応じて、​**\[Client App ID (クライアントアプリケーション ID)\]**​ 項目と ​**\[Client Secret (クライアントシークレット)\]**​ 項目に入力します。
    
    - **Connected App (接続アプリケーション)**
        
        **\[Anypoint Platform\]**​ > ​**\[Access Management (アクセス管理)\]**​ > ​**\[Connected Apps (接続アプリケーション)\]**​ から ​**\[ID\]**​ と ​**\[Secret (シークレット)\]**​ の値を貼り付けます。
        
        Anypoint MQ での接続アプリケーションの設定についての詳細は、 [接続アプリケーションの設定](https://docs.mulesoft.com/jp/mq/mq-connected-apps) を参照してください。
    - **Client App (クライアントアプリケーション)**
        
        **\[Anypoint Platform\]**​ > ​**\[MQ\]**​ > ​**\[Client Apps (クライアントアプリケーション)\]**​ から ​**\[Client App ID (クライアントアプリケーション ID)\]**​ と ​**\[Client Secret (クライアントシークレット)\]**​ の値を貼り付けます。
        
        Anypoint MQ でのクライアントアプリケーションの設定についての詳細は、 [クライアントアプリケーションの設定](https://docs.mulesoft.com/jp/mq/mq-client-apps) を参照してください。

## [](#アップグレード後の手順)アップグレード後の手順

コネクタの最新バージョンをインストールしたら、次の手順に従ってアップグレードを完了します。

1. Anypoint Studio で、​**\[Problems (問題)\]**​ ビューまたは ​**\[Console (コンソール)\]**​ ビューにエラーがないことを確認します。
2. プロジェクトの pom.xml を確認し、問題がないことを確認します。
3. 接続をテストして、操作が機能することを確認します。

## [](#トラブルシューティング)トラブルシューティング

パラメーターのキャッシュおよびメタデータのキャッシュで問題が発生した場合、Anypoint Studio を再起動しください。

### [](#アップグレードの取り消し)アップグレードの取り消し

前のバージョンの Anypoint MQ Connector に戻すには、Anypoint Studio で、プロジェクトの ​`pom.xml`​ ファイル内の ​`mq-connector`​ 連動関係バージョンを前のバージョンに変更します。

## [](#関連情報)関連情報

- [Anypoint Connector の概要](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)
- [MuleSoft ヘルプセンター](https://help.mulesoft.com)