ポート番号の確認
StreamBase Studioや外部サーバにて複数Eventflow・LiveViewフラグメントを起動する場合、特に設定のない場合は空いているポートからランダムに一つずつ利用します。ポート番号を確認するにはepadminコマンドを利用します。フラグメント別にそれぞれ以下のコマンドを実行します。
Eventflowの場合:
epadmin display services --servicetype=eventflow
出力例:
Service Name = eventflow.com_tibco_sb_sample_bestbidsandasks_BestBidsAsks0_BestBidsAsks.sbuser
Service Type = eventflow
Network Address = sb://Graemsay.local:13596
LiveViewの場合:
epadmin display services --servicetype=liveview
出力例:
Service Name = liveview.liveview0.sample_lv_sample_helloliveview.sbuser Service Type = liveview Network Address = sb://Graemsay.local:10000 lv://Graemsay.local:8888
それぞれの出力例の通り、実行中の各フラグメントに対して3行ずつ情報が表示されます。ポート番号は3行目のNetwork Addressより参照いただけます。
ポート番号の変更・固定
フラグメントのポートを変更ないし固定する場合は、別途HOCONファイルをプロジェクトに追加する必要があります。以下はLiveViewフラグメントのアクセスポートを変更する手順となります。
Studioを開いた状態で、プロジェクトのmain/src/configurationフォルダを右クリックし、"New">"StreamBase HOCON Configuration File"を選択します。
ファイル名(任意)と構成タイプ(Configuration Types)を選択します。LiveViewの場合、検索欄に"listener"と入力のし、表示されるLiveView Client API Listenerをタイプとして選択します。
※Eventflowの場合はEventflow Client API Listenerとなります
最後にFinishをクリックします。
指定のフォルダ配下に作成されたHOCONファイル(例ではlvApiListener.conf)を開きます。エディタが右中央に表示されますので、下記のようにClientAPIListener内部にportNumberの項目を追加し、ポート番号を入力してください。
編集終了後は変更を保存します。
name = "sample-ClientAPIListener-document"
type = "com.tibco.ep.ldm.configuration.ldmclientapilistener"
version = "1.0.0"
configuration = {
ClientAPIListener = {
portNumber = 11888
}
}
※Eventflowフラグメントの場合は以下のようになります。
name = "sample-ClientAPIListener-document"
type = "com.tibco.ep.streambase.configuration.sbclientapilistener"
version = "1.0.0"
configuration = {
// EventFlow client API listener configuration.
ClientAPIListener = {
apiListenerAddress = {
portNumber = 11000
}
}
}