

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# MQTT 3.1.1 ブローカー (モケット)
<a name="mqtt-broker-moquette-component"></a>

モケット MQTT ブローカーコンポーネント (`aws.greengrass.clientdevices.mqtt.Moquette`) は、クライアントデバイスと Greengrass コアデバイス間の MQTT メッセージを処理します。このコンポーネントは、[モケット MQTT ブローカー](https://github.com/moquette-io/moquette)の修正バージョンを提供します。この MQTT ブローカーをデプロイして、軽量 MQTT ブローカーを実行します。MQTT ブローカーの選択方法の詳細については、「[MQTT ブローカーを選択する](choose-local-mqtt-broker.md)」を参照してください。

このブローカーは、MQTT 3.1.1 プロトコルを実装します。これには、QoS 0、QoS 1、QoS 2 が保持するメッセージ、最終意志メッセージ、永続セッションに対するサポートが含まれます。

**注記**  <a name="client-device-component-context"></a>
クライアントデバイスは、Greengrass コアデバイスに接続し、処理するために MQTT メッセージとデータを送信するローカル IoT デバイスです。詳細については、「[ローカル IoT デバイスとやり取りする](interact-with-local-iot-devices.md)」を参照してください。

**Topics**
+ [バージョン](#mqtt-broker-moquette-component-versions)
+ [タイプ](#mqtt-broker-moquette-component-type)
+ [オペレーティングシステム](#mqtt-broker-moquette-component-os-support)
+ [要件](#mqtt-broker-moquette-component-requirements)
+ [依存関係](#mqtt-broker-moquette-component-dependencies)
+ [構成](#mqtt-broker-moquette-component-configuration)
+ [ローカルログファイル](#mqtt-broker-moquette-component-log-file)
+ [変更ログ](#mqtt-broker-moquette-component-changelog)

## バージョン
<a name="mqtt-broker-moquette-component-versions"></a>

このコンポーネントには、次のバージョンがあります。
+ 2.3.x
+ 2.2.x
+ 2.1.x
+ 2.0.x

## タイプ
<a name="mqtt-broker-moquette-component-type"></a>

<a name="public-component-type-plugin-para1"></a>このコンポーネントはプラグインコンポーネント (`aws.greengrass.plugin`) です。[Greengrass nucleus](greengrass-nucleus-component.md) は、nucleus と同じ Java バーチャルマシン (JVM) でこのコンポーネントを実行します。コアデバイスでこのコンポーネントのバージョンを変更するとき、nucleus が再起動します。

<a name="public-component-type-plugin-para2"></a>このコンポーネントは、Greengrass nucleus と同じログファイルを使用します。詳細については、「[AWS IoT Greengrass ログのモニタリング](monitor-logs.md)」を参照してください。

<a name="public-component-type-more-information"></a>詳細については、「[コンポーネントタイプ](develop-greengrass-components.md#component-types)」を参照してください。

## オペレーティングシステム
<a name="mqtt-broker-moquette-component-os-support"></a>

このコンポーネントは、次のオペレーティングシステムを実行するコアデバイスにインストールできます。
+ Linux
+ Windows

## 要件
<a name="mqtt-broker-moquette-component-requirements"></a>

このコンポーネントには次の要件があります。
+ コアデバイスは、MQTT ブローカーが動作するポートで接続を受け入れられる必要があります。このコンポーネントは、デフォルトでポート 8883 で MQTT ブローカーを実行します。このコンポーネントを設定するとき、別のポートを指定できます。

  <a name="mqtt-broker-configuration-mqtt-bridge-requirement"></a>別のポートを指定し、[MQTT ブリッジコンポーネント](mqtt-bridge-component.md)を使用して MQTT メッセージを他のブローカーにリレーする場合、MQTT ブリッジ v2.1.0 以降を使用する必要があります。MQTT ブローカーが動作するポートを使用するように設定します。

  <a name="mqtt-broker-configuration-ip-detector-requirement"></a>別のポートを指定し、[IP ディテクターコンポーネント](ip-detector-component.md)を使用して MQTT ブローカーエンドポイントを管理する場合、IP ディテクタ v2.1.0 以降を使用する必要があります。MQTT ブローカーが動作するポートを報告するように設定します。
+ Moquette MQTT ブローカーコンポーネントは、VPC での実行がサポートされています。

## 依存関係
<a name="mqtt-broker-moquette-component-dependencies"></a>

コンポーネントをデプロイすると、 は互換性のあるバージョンの依存関係 AWS IoT Greengrass もデプロイします。つまり、コンポーネントを正常にデプロイするには、コンポーネントとその依存関係のすべての要件を満たす必要があります。このセクションでは、このコンポーネントの[リリースされたバージョン](#mqtt-broker-moquette-component-changelog)の依存関係と、各依存関係に対するコンポーネントのバージョンを定義するセマンティックバージョン制約をリスト表示しています。コンポーネントの各バージョンの依存関係は、[AWS IoT Greengrass コンソール](https://console.aws.amazon.com//greengrass)でも確認できます。コンポーネントの詳細ページで **[Dependencies]** (依存関係) リストを確認します。

------
#### [ 2.3.7 ]

次の表に、このコンポーネントのバージョン 2.3.7 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [クライアントデバイス認証](client-device-auth-component.md) | >=2.2.0 <2.6.0 | ハード | 

------
#### [ 2.3.2 – 2.3.6 ]

次の表に、このコンポーネントのバージョン 2.3.2 から 2.3.6 までの依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [クライアントデバイス認証](client-device-auth-component.md) | >=2.2.0 <2.5.0 | ハード | 

------
#### [ 2.3.0 and 2.3.1 ]

次の表に、このコンポーネントのバージョン 2.3.0 および 2.3.1 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [クライアントデバイス認証](client-device-auth-component.md) | >=2.2.0 <2.4.0 | ハード | 

------
#### [ 2.2.0 ]

次の表に、このコンポーネントのバージョン 2.2.0 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [クライアントデバイス認証](client-device-auth-component.md) | >=2.2.0 <2.3.0 | ハード | 

------
#### [ 2.1.0 ]

次の表に、このコンポーネントのバージョン 2.1.0 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [クライアントデバイス認証](client-device-auth-component.md) | >=2.0.0 <2.2.0 | ハード | 

------
#### [ 2.0.0 - 2.0.2 ]

次の表に、このコンポーネントのバージョン 2.0.0 から 2.0.2 までの依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [クライアントデバイス認証](client-device-auth-component.md) | >=2.0.0 <2.1.0 | ハード | 

------

コンポーネントの依存関係の詳細については、「[コンポーネント recipe のリファレンス](component-recipe-reference.md#recipe-reference-component-dependencies)」を参照してください。

## 構成
<a name="mqtt-broker-moquette-component-configuration"></a>

このコンポーネントには、コンポーネントのデプロイ時にカスタマイズできる次の設定パラメータが用意されています。

`moquette`  
(オプション) 使用する[モケット MQTT ブローカー](https://github.com/moquette-io/moquette)設定。このコンポーネントでモケット設定オプションのサブセットを設定できます。詳細については、[モケット設定ファイル](https://github.com/moquette-io/moquette/blob/main/distribution/src/main/resources/moquette.conf)のインラインコメントを参照してください。  
このオブジェクトには、次の情報が含まれます。    
`ssl_port`  
(オプション) MQTT ブローカーが動作するポート。  
<a name="mqtt-broker-configuration-mqtt-bridge-requirement"></a>別のポートを指定し、[MQTT ブリッジコンポーネント](mqtt-bridge-component.md)を使用して MQTT メッセージを他のブローカーにリレーする場合、MQTT ブリッジ v2.1.0 以降を使用する必要があります。MQTT ブローカーが動作するポートを使用するように設定します。  
<a name="mqtt-broker-configuration-ip-detector-requirement"></a>別のポートを指定し、[IP ディテクターコンポーネント](ip-detector-component.md)を使用して MQTT ブローカーエンドポイントを管理する場合、IP ディテクタ v2.1.0 以降を使用する必要があります。MQTT ブローカーが動作するポートを報告するように設定します。
デフォルト: `8883`  
`host`  
(オプション) MQTT ブローカーがバインドするインターフェイス。例えば、MQTT ブローカーが特定のローカルネットワークにのみバインドするように、このパラメータを変更できます。  
デフォルト: `0.0.0.0` (すべてのネットワークインターフェイスにバインドする)

startupTimeoutSeconds  
(オプション) コンポーネントが起動する最大時間 (秒)。このタイムアウトを超えている場合、コンポーネントの状態が `BROKEN` に変わります。  
デフォルト: `120`

**Example 例: 設定マージの更新**  
次の設定例では、MQTT ブローカーをポート 443 で操作するように指定しています。  

```
{
  "moquette": {
    "ssl_port": "443"
  }
}
```

## ローカルログファイル
<a name="mqtt-broker-moquette-component-log-file"></a>

このコンポーネントは、[Greengrass nucleus](greengrass-nucleus-component.md) コンポーネントと同じログファイルを使用します。

------
#### [ Linux ]

```
/greengrass/v2/logs/greengrass.log
```

------
#### [ Windows ]

```
C:\greengrass\v2\logs\greengrass.log
```

------

**このコンポーネントのログを確認するには**
+ コアデバイスに次のコマンドを実行して、このコンポーネントのログファイルをリアルタイムに確認します。`/greengrass/v2` または *C:\$1greengrass\$1v2* を AWS IoT Greengrass ルートフォルダへのパスに置き換えます。

------
#### [ Linux ]

  ```
  sudo tail -f /greengrass/v2/logs/greengrass.log
  ```

------
#### [ Windows (PowerShell) ]

  ```
  Get-Content C:\greengrass\v2\logs\greengrass.log -Tail 10 -Wait
  ```

------

## 変更ログ
<a name="mqtt-broker-moquette-component-changelog"></a>

次の表は、コンポーネントの各バージョンにおける変更を示します。


|  **バージョン**  |  **変更**  | 
| --- | --- | 
|  2.3.7  |  [クライアントデバイス認証](client-device-auth-component.md)バージョン 2.5.0 リリース用に、バージョンが更新されました。  | 
|  2.3.6  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/mqtt-broker-moquette-component.html)  | 
|  2.3.5  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/mqtt-broker-moquette-component.html)  | 
|  2.3.4  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/mqtt-broker-moquette-component.html)  | 
|  2.3.3  |  <a name="changelog-mqtt-broker-moquette-2.3.3"></a>[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/mqtt-broker-moquette-component.html)  | 
|  2.3.2  |  [クライアントデバイス認証](client-device-auth-component.md)バージョン 2.4.0 リリース用に、バージョンが更新されました。  | 
|  2.3.1  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/mqtt-broker-moquette-component.html)  | 
|  2.3.0  |  証明書チェーンのサポートを追加しました。  | 
|  2.2.0  |  [クライアントデバイス認証](client-device-auth-component.md)バージョン 2.2.0 リリース用にバージョンが更新されました。  | 
|  2.1.0  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/mqtt-broker-moquette-component.html)  | 
|  2.0.2  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/mqtt-broker-moquette-component.html)  | 
|  2.0.1  |  Greengrass nucleus バージョン 2.4.0 のリリース用にバージョンが更新されました。  | 
|  2.0.0  |  当初のバージョン  | 