Sample program source code:
1 | import java.io.BufferedOutputStream; |
The following data are obtained from the arguments at runtime:
Argument | Variable | Use |
---|---|---|
1 | hostName | CEP Server host name |
2 | engineName | CEP engine name |
3 | dataType | Event data format |
4 | charSet | Character set |
5 | eventTypeId | Event type ID |
6 | data | Event data |
7 | lWait | Data transmission wait time |
8 | loop | Data transmission count |
An example of sample execution is shown below.
In this example, debug information is output to the engine log by using DebugLogListener.
Command execution result
# java -cp ./ HttpClient localhost CepEngine CSV UTF-8 CSVEvent HTTP,CSV,%COUNTER% 1 3 <ENTER>
Code=0 Message=Sending message completed normally.
Code=0 Message=Sending message completed normally.
Code=0 Message=Sending message completed normally.
Engine log output result
2012-07-29 13:05:02,954 [DEBUG] abc:length=1
abc[0]
operation :CSV: String
count :0: String
ID :HTTP: String
2012-07-29 13:05:03,027 [DEBUG] abc:length=1
abc[0]
operation :CSV: String
count :1: String
ID :HTTP: String
2012-07-29 13:05:03,108 [DEBUG] abc:length=1
abc[0]
operation :CSV: String
count :2: String
ID :HTTP: String
An example of sample execution is shown below.
In this example, debug information is output to the engine log by using DebugLogListener.
Command execution result
# java -cp ./ HttpClient localhost CepEngine XML UTF-8 XMLEvent '<?xml version="1.0"\
encoding="UTF-8"?><XMLEvent><ID>HTTP</ID> <operation>XML</operation>\ <count>%COUNTER%</count></XMLEvent>' 1 3 <ENTER>
Code=0 Message=Sending message completed normally.
Code=0 Message=Sending message completed normally.
Code=0 Message=Sending message completed normally.
Please note that we added backslash ("\") and newline characters in the command line example above for readability only - the actual command line does not have a backslash and newline.
Engine log output result
2012-07-29 13:07:32,670 [DEBUG] abc--0:length=1
abc--0[0]
operation :XML: String
count :0: String
ID :HTTP: String
2012-07-29 13:07:32,685 [DEBUG] abc--0:length=1
abc--0[0]
operation :XML: String
count :1: String
ID :HTTP: String
2012-07-29 13:07:32,698 [DEBUG] abc--0:length=1
abc--0[0]
operation :XML: String
count :2: String
ID :HTTP: String