public HTTPRequestService(MsgCommandChannel<?> msgCommandChannel) { this.msgCommandChannel = msgCommandChannel; if (msgCommandChannel.builder.getHTTPClientConfig().isTLS()) { msgCommandChannel.pcm.ensureSize(ClientHTTPRequestSchema.class, 4, SSLUtil.MinTLSBlock); } msgCommandChannel.initFeatures |= MsgCommandChannel.NET_REQUESTER; }
ClientHostPortConfig config = clientConfig.newHTTPSession(host, port); int base = ClientHostPortInstance.getSessionCount(); int i = parallelTracks; clientConfig.setResponseQueueLength(maxInFlight*responseMultiplier); //parser->responder clientConfig.setMaxResponseSize(maxExpectedMessageSizeFromServer); clientConfig.setMaxRequestSize(256);//TODO: what is the expected request size.. clientConfig.setRequestQueueLength(maxInFlight); clientConfig.setConcurentPipesPerWriter(Math.max(4, parallelTracks*sessionCount)); clientConfig.setSocketWriterCount(Math.min(4, sessionCount));
@Override public void declareConfiguration(GreenFramework c) { //c.useInsecureNetClient(); HTTPClientConfig netClientConfig = c.useInsecureNetClient();//NetClient(); session1 = netClientConfig .newHTTPSession("127.0.0.1", port) .parseJSON() .integerField("age", Fields.AGE) .stringField("name", Fields.NAME) .finish(); session2 = netClientConfig .newHTTPSession("127.0.0.1", port) .parseJSON() .integerField("age", Fields.AGE) .stringField("name", Fields.NAME) .finish(); if (telemetry) { c.enableTelemetry(); } }
@Override public void declareConfiguration(GreenFramework builder) { HTTPServerConfig server = builder.useHTTP1xServer(port) .setConcurrentChannelsPerDecryptUnit(4) .setConcurrentChannelsPerEncryptUnit(4) .setHost("127.0.0.1"); if (!useTLS) { server.useInsecureServer(); } builder.defineRoute().path("/proxy").routeId(Struct.PROXY_ROUTE); builder.defineRoute().path("/service").routeId(Struct.SERIVCE_ROUTE); HTTPClientConfig client = useTLS ? builder.useNetClient() : builder.useInsecureNetClient(); session = client.newHTTPSession("127.0.0.1", port).finish(); GraphManager.showThreadIdOnTelemetry = true; GraphManager.showScheduledRateOnTelemetry = true; // builder.enableTelemetry(); }
public HTTPRequestService(MsgCommandChannel<?> msgCommandChannel, int queueLength, int maxMessageSize) { this.msgCommandChannel = msgCommandChannel; if (msgCommandChannel.builder.getHTTPClientConfig().isTLS()) { //TLS must have at lest 33305 int tlsBody = Math.max(SSLUtil.MinTLSBlock, maxMessageSize); int tlsLen = Math.max(Math.min(queueLength, (1<<27)/tlsBody),4); msgCommandChannel.pcm.ensureSize(ClientHTTPRequestSchema.class, tlsLen, tlsBody); } else { msgCommandChannel.pcm.ensureSize(ClientHTTPRequestSchema.class, queueLength, maxMessageSize); } MsgCommandChannel.growCommandCountRoom(msgCommandChannel, queueLength); msgCommandChannel.initFeatures |= MsgCommandChannel.NET_REQUESTER; }