mirror of https://github.com/apache/nifi.git
NIFI-9506: Fixed Nifi reconnects with websocket server each second
This closes #5645. Signed-off-by: Peter Turcsanyi <turcsanyi@apache.org>
This commit is contained in:
parent
6039095625
commit
16bedc50fa
|
@ -128,9 +128,8 @@ public abstract class AbstractWebSocketGatewayProcessor extends AbstractSessionF
|
|||
if (context.hasIncomingConnection()) {
|
||||
final ProcessSession session = processSessionFactory.createSession();
|
||||
final FlowFile flowFile = session.get();
|
||||
final Map<String, String> attributes = flowFile.getAttributes();
|
||||
try {
|
||||
webSocketClientService.connect(endpointId, attributes);
|
||||
webSocketClientService.connect(endpointId, flowFile.getAttributes());
|
||||
} finally {
|
||||
session.remove(flowFile);
|
||||
session.commitAsync();
|
||||
|
@ -195,7 +194,7 @@ public abstract class AbstractWebSocketGatewayProcessor extends AbstractSessionF
|
|||
throw new ProcessException("Failed to register processor to WebSocket service due to: " + e, e);
|
||||
}
|
||||
|
||||
} else {
|
||||
} else if (context.hasIncomingConnection()) {
|
||||
try {
|
||||
onWebSocketServiceReady(webSocketService, context);
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Reference in New Issue