You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Generic Producer Configuration Parameters

  • name (string, required) 
    • Unique name to identify the stage in the pipeline. It is used programmatically to retrieve the stage and consume the produced output.
  • queueSize (integer, optional) - Default 10000
    • Max number of produced items to keep in memory at a time.
  • queueTimeout (integer, optional) - Default 1000 ms
    • Blocking queue timeout to wait for new items.
  • queueRetries (integer, optional) - Default 3
    • Number of retries before unblocking the queue.
  • singleSubscriber (boolean, optional) - Default to false
    • If true, a single queue is created and a thread can consume the items being produced by multiple reset/advance calls to the engine.
      If false, each time an engine reset is issued, the queue is cleared (consume the queue before reset).
      Single subscriber works well with asynchronous subscription to the queue.

Get a reference to the producer stage and consume the queue

Producer Stage
ResultsProducerStage stage = engine.getProducer("ProducerName");
String inputText = "This is a test entry";
Reader in = new StringReader(inputText);
engine.reset(in);
while(engine.advance() != null);
List<String> output = (List<String>) producer.stream().collect(Collectors.toList());
  • No labels