use of io.mantisrx.connector.publish.source.http.PushHttpSource in project mantis by Netflix.
the class PushRequestEventSourceJob method getJobInstance.
@Override
public Job<String> getJobInstance() {
String jobId = Utils.getEnvVariable("JOB_ID", "PushRequestEventSourceJobLocal-1");
String mantisClientId = MANTIS_CLIENT_ID + "_" + jobId;
QueryRegistry queryRegistry = new QueryRegistry.Builder().withClientIdPrefix(mantisClientId).build();
String customPortName = "MANTIS_WORKER_CUSTOM_PORT";
String consolePort = Utils.getEnvVariable(customPortName, "9090");
int port = 9090;
if (consolePort != null && !consolePort.isEmpty()) {
port = Integer.parseInt(consolePort);
}
return MantisJob.source(new PushHttpSource(queryRegistry, port)).stage(new EchoStage(), EchoStage.config()).sink(new SourceSink(new RequestPreProcessor(queryRegistry), new RequestPostProcessor(queryRegistry), mantisClientId)).parameterDefinition(new IntParameter().name(MantisSourceJobConstants.ECHO_STAGE_BUFFER_MILLIS).description("millis to buffer events before processing").validator(Validators.range(100, 1000)).defaultValue(250).build()).metadata(new Metadata.Builder().name("PushRequestEventSourceJob").description("Fetches request events from any source in a distributed manner. " + "The output is served via HTTP server using SSE protocol.").build()).create();
}
Aggregations