Deploying and Managing Apama Applications > Event Correlator Utilities Reference > Starting the event correlator > Description of slow receivers > Sending events to correlators
Sending events to correlators
The engine_send tool sends Apama-format events into an event correlator or IAF adapter. The executable for this tool is located in the bin directory of the Apama installation. Running the tool in the Apama Command Prompt ensures that the environment variables are set correctly.
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 an event correlator or IAF adapter:
*On Windows, run engine_send.exe.
*On UNIX, run engine_send.
To obtain the following usage message, run the command without any options or with the –h option:
Usage: engine_send [ options ] [ file1 [ file2 ... ] ]
In order to send to a Correlator or IAF.
Where options include:
-h | --help This message
-n | --hostname <host> Connect to an engine on <host>
-p | --port <port> Engine is listening on <port>
-l | --loop <count> Loop through input <count> times
-v | --verbose Be more verbose
-u | --utf8 Assume input is in UTF8
-V | --version Print program version info
Use '-' to read from <stdin>
Loop count < 0 means loop forever
Description
The engine_send tool sends Apama-format events to an event 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 ""or not specify a filename and the correlator reads events from stdin until it receives an end-of-file signal (Ctrl-D on UNIX and Ctrl-Z on Windows).
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.
You can also use engine_send to send events directly to the Integration Adapter Framework (IAF). To do this, specify the port of the IAF, by default this is 16903.
Options
The engine_send tool takes the following command line options:
Option
Description
-h
Displays usage information. Optional.
-n host
Name of the host on which the event correlator to which you want to send events is running. Optional. The default is localhost.
Note: Non-ASCII characters in host names are not supported.
-p port
Port on which the event correlator is listening. Optional. The default is 15903.
-v
Requests verbose output during execution. Optional.
-V
Displays version information for the engine_send tool. Optional.
-l loop
Number of times to cycle through and send the input events. Optional. Replace loop with one of the following values:
*0 — Indicates that you want the engine_send tool to iterate through and send the input data once. This is the default.
*Any negative integer— Indicates that you want the engine_send tool to indefinitely cycle through and send the input events.
*Any positive integer — Indicates the number of times to cycle through and send the input events.
The engine_send tool ignores this option if you specify it and the input is from stdin.
-u
Indicates that input files are in UTF-8 encoding. This specifies that the engine_send utility should not convert the input to any other encoding.
Operands
The engine_send tool takes the following operands:
[ 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 following exit values are returned:
0
The events were sent successfully.
1
No connection to the event 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 the engine_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.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.