Hi Julian, Christofer,


thank you for your replies! Context of my question is that I’m comparing
Apache Nifi/MiNiFi, StreamSets Data Collector/SDC Edge and Apache Edgent.
>From my first impression it seemed like that all of them support transport
via HTTP out of the box. Finally, I followed your advice and solved the
situation by moving on to MQTT with a mosquitto instance. (MiNiFi requires
some additional manual configuration to enable MQTT support.)



Very helpful was the SimplePublisherApp which is part of the examples:



https://github.com/apache/incubator-edgent-samples/tree/2fadbbf574ee9fbf0d839fe18ce23de20d6d5d21/connectors/src/main/java/org/apache/edgent/samples/connectors/mqtt



Many thanks,



Tom




2018-09-20 21:00 GMT+02:00 Tom G. <tom.gelbl...@googlemail.com>:

> Dear Apache Edgent community,
>
> I’m trying to figure out how to establish a HTTP connection between two
> Apache Edgent instances.
> I want to tail an active file and send the appended records via HTTP to
> another Apache Edgent instance.
> The second instance should receive these records via HTTP and write them
> to disk.
>
> My code for the first instance looks like this:
>
> package com.mycompany.app;
>
> import org.apache.edgent.connectors.http.*;
> import org.apache.edgent.connectors.file.*;
> import org.apache.edgent.providers.direct.DirectProvider;
> import org.apache.edgent.topology.TStream;
> import org.apache.edgent.topology.Topology;
>
> /**
>  * Edgent Application template.
>  */
>
> public class TemplateApp {
>
>     public static void main(String[] args) throws Exception {
>
>          //Create a provider
>         DirectProvider dp = new DirectProvider();
>
>         //Create a topology
>         Topology top = dp.newTopology();
>
>         //Build the topology
>         String watchedDir = "/tmp/test/";
>
>         //Read file
>         TStream<String> pathnames = FileStreams.directoryWatcher(top, ()
> -> watchedDir, null);
>         TStream<String> lines = FileStreams.textFileReader(pathnames);
>
>         //Insert filter here
>     lines.print();
>
>         //Insert ‘send data to HTTP server’ here
>
>         //Submit the topology
>         dp.submit(top);
>     }
> }
>
> How do I fill the gap after “//Insert ‘send data to HTTP server’ here” to
> be able to send the records to the second instance?
>
> How does the HTTP part of the second instance have to look like to be able
> to receive these records?
>
> Best regards,
>
> Tom
>
>

Reply via email to