Sending events to correlators
The engine_send
tool sends Apama-format events into a correlator. The executable for this tool is located in the Apama/bin
directory.
If the events you want to send are not in Apama format, you must use an adapter that can transform your event format into Apama event format.
Synopsis
To send Apama-format events to a correlator, run the following command:
engine_send [ options ] [ file1 [ file2... ] ]
When you run this command with the –h
option, the usage message for this command is shown.
Description
The engine_send
tool sends Apama-format events to a correlator. In Apama-format event files, you can specify whether to send the events in batches of one or more events or at set time intervals.
The correlator reads events from one or more specified files. Alternatively, you can specify a hyphen (-) or not specify a filename so that the correlator reads events from stdin
until it receives an end-of-file signal (Ctrl+D).
For details about Apama-format events, see Event file format.
By default, the engine_send
tool is silent unless an error occurs. To view progress information during engine_send
execution, specify the -v
option when you invoke engine_send
.
Options
The engine_send
tool takes the following options:
Option |
Description |
---|---|
|
Displays usage information. Optional. |
|
Name of the host on which the correlator to which you want to send events is running. Optional. The default is |
|
Port on which the correlator is listening. Optional. The default is |
|
For events for which a channel is not specified, this option designates the delivery channel. If a channel is not specified for an event and you do not specify this option, the event is delivered to the default channel, which is the empty string. All public contexts receive events sent to the default channel. |
|
Number of times to cycle through and send the input events. Optional. Replace count with one of the following values: -
The |
|
Requests verbose output during execution. Optional. |
|
Indicates that input files are in UTF-8 encoding. This specifies that the |
|
Displays version information for the |
Operands
The engine_send
tool takes the following operands:
Operand | Description |
---|---|
[ file1 [ file2... ] ] |
Specify zero, one, or more files that contain event data. Each file you specify must comply with the event file format described in Event file format. If you do not specify any filenames, the engine_send tool takes input from stdin . |
Exit status
The engine_send
tool returns the following exit values:
Value | Description |
---|---|
0 |
The events were sent successfully. |
1 |
No connection to the correlator was possible or the connection failed. |
2 |
One or more other errors occurred while sending the events. |
Operating notes
To end an indefinite cycle of sending events, press Ctrl+C in the window in which you invoked the engine_send
tool.
You might want to indefinitely cycle through and send events in the following situations:
- In test environments. For example, you can use
engine_send
to simulate heartbeats. If you then kill theengine_send
process, you can test your EPL code that detects when heartbeats stop. - In production environments. For example, you can use the
engine_send
tool to initialize a large data table in the correlator.
Text encoding
By default, the engine_send
tool checks the environment variable or global setting that specifies the locale because this indicates the local character set. The engine_send
tool then translates EPL text from the local character set to UTF-8. Consequently, it is important to correctly set the machine’s locale.
However, some input files might start with a UTF-8 Byte Order Mark. The engine_send
tool treats such input files as UTF-8 and does not do any translation. Alternatively, you can specify the -u
option when you run the engine_send
tool. This forces the tool to treat each input file as UTF-8.