use of com.yahoo.documentapi.ThroughputLimitQueue in project vespa by vespa-engine.
the class DummyReceiver method init.
public void init() {
MessageBusParams params = new MessageBusParams(new LoadTypeSet());
params.setRPCNetworkParams(new RPCNetworkParams().setIdentity(new Identity(name)));
params.setDocumentManagerConfigId("client");
params.getMessageBusParams().setMaxPendingCount(maxPendingCount);
params.getMessageBusParams().setMaxPendingSize(0);
da = new MessageBusDocumentAccess(params);
queue = (maxQueueTime < 0) ? new LinkedBlockingDeque<>() : new ThroughputLimitQueue<>(maxQueueTime);
session = da.getMessageBus().createDestinationSession("default", true, this);
executor = new ThreadPoolExecutor(threads, threads, 5, TimeUnit.SECONDS, queue, new DaemonThreadFactory());
System.out.println("Registered listener at " + name + "/default with " + maxPendingCount + " max pending and sleep time of " + sleepTime);
}
Aggregations