TCP Server Connector

Version 24.1.8899


TCP Server Connector


TCP Server connectors support hosting a generic endpoint for receiving data over TCP.

Overview

Each TCP Server connector listens on a specified port for incoming TCP traffic, either with TLS/SSL encryption or plain text. Use this connector when CData Arc needs to receive arbitrary data that does not necessarily fit into the constraints provided by other standard protocols.

Since TCP traffic is a constant stream that does not intrinsically have a start or end point, you must configure the connector to determine where one message ends and the next begins. The connector supports two approaches:

  • A static string/character delimiter that ends the current message or begins the next message
  • Reading a value in the incoming TCP data to determine how long the message should be

For the second approach, the connector requires an offset (how many bytes after the first byte to begin reading the message length) and a size (how many bytes to read, starting at the offset, to get the length value). If the length of the message is the first value in the header for the message, the offset is 0.

Once the delimiter or length is reached, the connector pushes a message into the Arc flow containing the raw data received over TCP.

The TCP Server connector can also generate an Arc message when a client connects or disconnects, to alert other processes within the flow. See the Connected and Disconnected Messages section for more information.

For information on sending responses back to TCP clients, see the Sending Messages section.

Connector Settings

Settings Tab

Configuration

Settings related to the core configuration of the connector.

  • コネクタId コネクタの静的な一意の識別子。
  • コネクタの種類 コネクタ名とその機能の説明が表示されます。
  • コネクタの説明 コネクタとフローにおけるロールについて自由形式の説明を記載するオプションのフィールド。
  • Port The port on which to listen for incoming TCP connections.

Message Decoding

Settings related to distinguishing individual messages from the TCP stream.

  • Message Start Delimiter The character or string indicating the start of a new message.
  • Message End Delimiter The character or string indicating the end of the current message.
  • Message Length Offset The number of bytes to skip before beginning to read the length of the message from the incoming data.
  • Message Length Size The size in bytes of the length value in the incoming data.

TLS Settings

Settings related to TLS/SSL transport security.

  • Enable TLS Whether clients must negotiate TLS/SSL encryption to connect to the TCP server.
  • Server Certificate The TLS/SSL certificate that identifies the TCP server.
  • Certificate Password The password to access the server certificate’s private key.

Automation Tab

Automation

Settings related to the automatic processing of files by the connector.

  • Send Whether messages arriving at the connector are automatically processed.

Performance

コネクタへのリソースの割り当てに関する設定。

  • 最大ワーカー数 このコネクタでファイルを処理するためにスレッドプールで消費されるワーカースレッドの最大数。設定された場合、これは設定 > オートメーションページのデフォルト設定をオーバーライドします。
  • 最大ファイル数 コネクタに割り当てられた各スレッドが送信するファイルの最大数。設定された場合、これは設定 > オートメーションページのデフォルト設定をオーバーライドします。

アラートタブ

アラートとサービスレベル(SLA)の設定に関連する設定。

コネクタのE メール設定

サービスレベル(SLA)を実行する前に、通知用のE メールアラートを設定する必要があります。アラートを設定をクリックすると、新しいブラウザウィンドウで設定ページが開き、システム全体のアラートを設定することができます。詳しくは、アラートを参照してください。

サービスレベル(SLA)の設定

サービスレベルでは、フロー内のコネクタが送受信すると予想される処理量を設定し、その量が満たされると予想される時間枠を設定できます。CData Arc は、サービスレベルが満たされていない場合にユーザーに警告するE メールを送信し、SLA を At Risk(危険) としてマークします。これは、サービスレベルがすぐに満たされない場合に Violated(違反) としてマークされることを意味します。これにより、ユーザーはサービスレベルが満たされていない理由を特定し、適切な措置を講じることができます。At Risk の期間内にサービスレベルが満たされなかった場合、SLA はViolated としてマークされ、ユーザーに再度通知されます。

サービスレベルを定義するには、予想処理量の条件を追加をクリックします。

  • コネクタに個別の送信アクションと受信アクションがある場合は、ラジオボタンを使用してSLA に関連する方向を指定します。
  • 検知基準(最小)を、処理が予想されるトランザクションの最小値(量)に設定し、フィールドを使用して期間を指定します。
  • デフォルトでは、SLA は毎日有効です。これを変更するには、毎日のチェックをOFF にし、希望する曜日のチェックをON にします。
  • 期間終了前にステータスを’At Risk’ に設定するタイミングを使用して、SLA がAt Risk としてマークされるようにします。
  • デフォルトでは、通知はSLA が違反のステータスになるまで送信されません。これを変更するには、‘At Risk’ 通知を送信のチェックをON にします。

次の例は、月曜日から金曜日まで毎日1000ファイルを受信すると予想されるコネクタに対して構成されたSLA を示しています。1000ファイルが受信されていない場合、期間終了の1時間前にAt Risk 通知が送信されます。

Advanced Tab

Keep Alive

Settings related to keep-alive packets sent by the server to maintain an idle connection.

  • Keep Alive Whether to send keep-alive packets periodically to ensure that idle connections are not closed due to inactivity.
  • Keep Alive Time The length of inactivity that should elapse before sending the first keep-alive packet.
  • Keep Alive Interval The interval between consecutive keep-alive packets.

Advanced Settings

Settings not included in the previous categories.

  • Connected Messages Whether the connector should generate an Arc message when a client connects. See the Connected and Disconnected Messages section for more information.
  • Disconnected Messages Whether the connector should generate an Arc message when a client disconnects. See the Connected and Disconnected Messages section for more information.
  • Idle Timeout The length of time (in seconds) the server should wait for an idle client before disconnecting them due to inactivity.
  • ローカルファイルスキーム コネクタがアウトプットするメッセージにファイル名を割り当てるスキーム。ファイル名にマクロを動的に使用して、識別子やタイムスタンプなどの情報を含めることができます。詳しくは、マクロ を参照してください。
  • Local Host The binding address of the local server, if not the default network interface.
  • Max Connections The maximum number of concurrent connectors.
  • TLS Enabled Protocols The list of TLS/SSL protocols supported when establishing outgoing connections. Best practice is to only use TLS protocols. Some obsolete operating systems do not support TLS 1.2.

Message

  • Sent フォルダに保存 チェックすると、コネクタで処理されたファイルをコネクタのSent フォルダにコピーします。
  • Sent フォルダのスキーム 選択された時間間隔に従ってSent フォルダ内のメッセージをグループ化するようコネクタに指示します。例えば、Weekly オプションを選択すると、コネクタは毎週新しいサブフォルダを作成してその週のすべてのメッセージをそのフォルダに格納します。ブランクに設定すると、コネクタはすべてのメッセージをSent フォルダに直接保存します。多くのメッセージを処理するコネクタの場合、サブフォルダを使用するとメッセージが整理されてパフォーマンスが向上します。

Logging

  • Log Level The verbosity of logs generated by the connector. When you request support, set this to Debug.
  • Log Subfolder Scheme Instructs the connector to group files in the Logs folder according to the selected interval. For example, the Weekly option instructs the connector to create a new subfolder each week and store all logs for the week in that folder. The blank setting tells the connector to save all logs directly in the Logs folder. For connectors that process many transactions, using subfolders helps keep logs organized and improves performance.
  • Log Messages Check this to have the log entry for a processed file include a copy of the file itself. If you disable this, you might not be able to download a copy of the file from the Input or Output tabs.

Miscellaneous

Miscellaneous settings are for specific use cases.

  • Other Settings Enables you to configure hidden connector settings in a semicolon-separated list (for example, setting1=value1;setting2=value2). Normal connector use cases and functionality should not require the use of these settings.

Server Tab

次の機能は、信頼されたIP アドレスセクションで利用可能です。  

  • 追加 新しいIP アドレスの範囲を入力するためのモーダルを開きます。
  • 編集 選択されたIP アドレスの範囲を編集するためのモーダルを開きます。
  • 削除 選択されたIP アドレスの範囲をリストから削除します。

この機能には次の制約が適用されます。

  • localhost を編集したり、リストから削除することはできません。
  • 定義された範囲外のIP アドレスは拒否されます。
  • 範囲指定に対応しています。例えば、エントリ100.10.100.1-15 は、100.10.100.1 から100.10.100.15 までのIP アドレスが許可されることを示します。
  • Classless Inter-Domain Routing (CIDR) 表記に対応しています。例えば、エントリ100.10.100.0/24 は、100.10.100.0 から100.10.100.255 までのIP アドレスが許可されることを示します。
  • ワイルドカードのパターンに対応しています。例えば、エントリ100.10.100.* は、100.10.100 で始まるIP アドレスが許可されることを示します。

Connected and Disconnected Messages

By default, the TCP Server connector only generates Arc messages when clients transfer data that the connector recognizes as a full message (according to the settings in the Message Decoding section). The connector can also generate Arc messages when a client connects to the server (if Connected Messages is enabled on the Advanced tab) or disconnects from the server (if Disconnected Messages is enabled on the Advanced tab).

When these special messages are generated, a special header is added to the Arc message:

x-tcpserver-event

This header is set to the value connected when clients are connecting, and disconnected when clients are disconnecting.

This header value must be checked by later connectors in the flow to detect whether a message written to the output folder of a TCP Server connector is one of these special messages.

Sending Messages

The TCP Server connector also uses a special header value to send messages back to connected clients:

x-tcpserver-connectionid

This header is added to any output messages generated by the connector, and is set to a Connection ID value that uniquely identifies the connected client. Messages that should be sent back to this client must have this header set to the same value to ensure that the message is sent to the appropriate client.

Since this header is already present on any messages written out by the connector, if the message passes through an Arc flow and arrives back at the Input for the TCP Server connector, it still has the same Connection ID value and is returned to the client that sent the original message. If the message cannot be directly routed back to the TCP Server connector, the Connection ID value must be saved and applied as a header (with the name shown above) to any new messages that should be returned to the client.

Macros

ファイルの命名規則にマクロを使用することで、組織の効率とデータの文脈的理解を高めることができます。マクロをファイル名に組み込むことで、識別子、タイムスタンプ、ヘッダー情報などの関連情報を動的に含めることができ、各ファイルに有益なコンテキストを付与できます。これにより、組織にとって重要な詳細をファイル名に反映させることができます。

CData Arc はこれらのマクロをサポートしており、すべて次の構文を使用します:%Macro%

Macro 説明
ConnectorID コネクタのConnectorID を返します。
Ext コネクタが処理中のファイルの拡張子を返します。
Filename コネクタが処理中のファイルのファイル名(拡張子を含む)を返します。
FilenameNoExt コネクタが処理中のファイルのファイル名(拡張子なし)を返します。
MessageId コネクタがアウトプットするメッセージのMessageId を返します。
RegexFilename:pattern コネクタで処理中のファイルのファイル名にRegEx パターンを適用します。
Header:headername コネクタが処理中のメッセージのヘッダー(headername)の値を返します。
LongDate システムの現在の日時を長い形式(例:Wednesday, January 24, 2024)で返します。
ShortDate システムの現在の日時をyyyy-MM-dd 形式(例:2024-01-24)で返します。
DateFormat:format システムの現在の日時を指定されたフォーマット(format)で返します。使用可能な日付フォーマットについては、サンプル日付フォーマット を参照してください。
Vault:vaultitem 指定されたvault 項目の値を返します。
ConnectionId Evaluates to the ConnectionId of the connection a client used to upload data.
RemoteHost Evaluates to the ConnectionId of the connection that the client used to upload data.

%Ext% や%ShortDate% などの引数を必要としないマクロもありますが、引数を必要とするマクロもあります。引数を渡すマクロはすべて次の構文を用います:%Macro:argument%

以下は、引数を渡すマクロの例です。

  • %Header:headername%:headername はメッセージのヘッダー名です。
  • %Header:mycustomheader% は、インプットメッセージで設定されたmycustomheader ヘッダーの値を返します。
  • %Header:ponum% は、インプットメッセージで設定されたponum ヘッダーの値に対応します。
  • %RegexFilename:pattern%:pattern は正規表現パターンです。例えば、%RegexFilename:^([\w][A-Za-z]+)% はファイル名の最初の単語と照合し、大文字と小文字を区別せずに結果を返します(test_file.xmltest に変換されます)。
  • %Vault:vaultitem%:vaultitem は、vault のアイテム名です。例えば、%Vault:companyname% はVault に保存されているcompanyname アイテムの値を返します。
  • %DateFormat:format%:format は使用可能な日付フォーマットです(詳細はサンプル日付フォーマット を参照してください)。例えば、%DateFormat:yyyy-MM-dd-HH-mm-ss-fff% はファイルの日付とタイムスタンプを返します。

以下の例に示すように、より詳細なマクロを作成することもできます。

  • 複数のマクロを1つのファイル名にまとめる:%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%%EXT%
  • マクロの外側にテキストを含める:MyFile_%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%
  • マクロ内にテキストを含める:%DateFormat:'DateProcessed-'yyyy-MM-dd_'TimeProcessed-'HH-mm-ss%