Jmeter-jms-topic-test-plan
jMeter-JMSトピックテスト計画
JMSトピックテスト計画の構築
次に、JMSプロバイダーをテストするためのJMeterテスト計画を作成しましょう。 1つのサブスクライバーと1つのパブリッシャーを作成します。 1つのスレッドグループを作成し、それぞれに2つの反復を設定します
まず、*/home/manisha/apache-jmeter2.9/bin/jmeter.sh。*からJMeterを起動します。
ユーザーを追加
今、次のようにスレッドグループを作成します-
- テスト計画を右クリック
- 追加→スレッド(ユーザー)→スレッドグループを選択します。 テスト計画ノードの下にスレッドグループが追加されます。
- このスレッドグループの名前を_JMS pub-sub user_に変更します。
_Loop Count_を2に変更します。 スレッドグループの残りのデフォルトプロパティは保持されます。 これは、1つのスレッドを持つ1つのスレッドグループ、または1人のユーザーがリクエストキューを介してそれぞれ2つのメッセージを送信することを意味します。
JMSサブスクライバーとパブリッシャーの追加
サブスクライバーとパブリッシャーを追加する方法を見てみましょう-
出版社を追加
- [追加]→[サンプラー]→[JMSパブリッシャー]を選択して、サンプラーJMSパブリッシャーをパブリッシャー要素に追加します。
- ツリーでJMS Publisher要素を選択します。
- 次のプロパティを編集します-
Property | Value | Description |
---|---|---|
Name | Sample Publisher | Descriptive name for this element that is shown in the tree. |
If the JMS provider uses the jndi.properties file | check the box | Use jndi.properties. Note that the file must be on the classpath − e.g. by updating the user.classpath JMeter property. If this option is not selected, JMeter uses the "JNDI Initial Context Factory" and "Provider URL" fields to create the connection. |
InitialContextFactory | org apache activemq jndi Active MQInitial Context Factory | Name of the context factory. |
Provider URL | tcp://localhost:61616 | The URL for the jms provider. |
Connection Factory | ConnectionFactory | The URL for the JMS provider. |
Destination | dynamicTopics/MyStaticTopic1 | The name of the message topic. For ActiveMQ Dynamic Topics (create topics dynamically). |
Number of samples to aggregate | 2 | Number of samples to aggregate. |
Message source | Textarea |
Where to obtain the message − From File-すべてのサンプルが参照ファイルを読み取り、再利用することを意味します。 フォルダーからのランダムファイル-指定されたフォルダーからランダムファイルが選択されることを意味します。このフォルダーには、Bytesメッセージの拡張子が.datのファイル、またはオブジェクトまたはテキストメッセージの拡張子が.txtまたは.objのファイルが含まれている必要があります テキスト領域-テキストまたはオブジェクトメッセージに使用するメッセージ |
Message type | Text | Text, Map, Object message or Bytes Message |
残りのプロパティはデフォルト値で保持されます。 次のスクリーンショットは、上記の構成を示しています-
サブスクライバーを追加
ユーザーを定義したので、今度はユーザーが実行するタスクを定義します。
- 追加→サンプラー→JMSサブスクライバーを選択して、サンプラーJMSサブスクライバーをサブスクライバー要素に追加します。
- ツリーでJMSサブスクライバー要素を選択します
- 次のプロパティを編集します-
Property | Value | Description |
---|---|---|
Name | Sample Subscriber | Descriptive name for this element that is shown in the tree. |
If the JMS provider uses the jndi.properties file | check the box | Use jndi.properties. Note that the file must be on the classpath − e.g. by updating the user.classpath JMeter property. If this option is not selected, JMeter uses the "JNDI Initial Context Factory" and "Provider URL" fields to create the connection. |
InitialContextFactory | org apache activemq jndi Active MQInitial Context Factory | Name of the context factory. |
Provider URL | tcp://localhost:61616 | The URL for the JMS provider. |
Connection Factory | ConnectionFactory | The URL for the JMS provider. |
Destination | dynamicTopics/MyStaticTopic1 | The name of the message topic. For ActiveMQ Dynamic Topics (create topics dynamically). |
Read response | Check Box | The sampler should read the response. If not, only the response length is returned. |
Timeout | 2000 | The timeout to be applied, in milliseconds. 0=none. This is the overall aggregate timeout, not per sample. |
残りのプロパティはデフォルト値で保持されます。 次のスクリーンショットは、上記の構成を示しています-
リスナーを作成
次に、リスナー要素を追加します。 この要素は、JMSリクエストのすべての結果をファイルに保存し、データの視覚モデルを提示します。
- スレッドグループ要素を選択します。
- [追加]> [リスナー]> [結果ツリーの表示]を選択して、結果ツリーの表示リスナーを追加します。
テスト計画を保存して実行する
ここで、上記のテスト計画を_jms_pub_sub.jmx_として保存します。 [実行]→[開始]オプションを使用して、このテスト計画を実行します。
出力を確認する
出版社向けの出力
サブスクライバー向けの出力
ActiveMQの管理コンソールに戻ります。 ここで、トピックのメッセージステータスを確認できます。