Custom
This sample shows how to integrate TNT4J-Streams into your custom API.
Sample files can be found in the com.jkoolcloud.tnt4j.streams.sample package.
SampleIntegration.java shows how to integrate TNT4J-Streams integration into your API. Also, integration can be made using StreamsAgent.runFromAPI(new CfgStreamsBuilder().setConfig(cfgFileName)) method.
SampleParser.java shows how to implement a custom parser.
SampleStream.java shows how to implement a custom stream.
Builder
This sample shows how to make a streaming application using the plain Java API without using a streams configuration xml file. The application does the same as the tnt4j-streams-core sample single-log. See Single Log file.
Sample files can be found in the com.jkoolcloud.tnt4j.streams.sample.builder package.
SampleStreamingApp.java shows how to configure and run a stream using the plain API.
Application parameters:
- Path to the
orders.logfile. If absent, then theorders.logfile must be in the working directory.
Running application:
- Build the module and use
run.bat/run.shfrom thesamples/stream-builderdirectory.
Or,
- Set this IDE
run configuration:- Main class:
com.jkoolcloud.tnt4j.streams.sample.builder.SampleStreamingApp - VM Options:
-Dtnt4j.config="./config/tnt4j.properties" -Dlog4j2.configurationFile="./config/log4j2.xml" - Program arguments:
./tnt4j-streams-samples/samples/stream-builder/orders.log - Working directory:
[YOUR_TNT4J_STREAMS_ROOT_DIR], e.g.,C:\PROJECTS\Nastel\tnt4j-streams - Class path:
tnt4j-streams-samplesmodule
- Main class: