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()) {
|
if (context.hasIncomingConnection()) {
|
||||||
final ProcessSession session = processSessionFactory.createSession();
|
final ProcessSession session = processSessionFactory.createSession();
|
||||||
final FlowFile flowFile = session.get();
|
final FlowFile flowFile = session.get();
|
||||||
final Map<String, String> attributes = flowFile.getAttributes();
|
|
||||||
try {
|
try {
|
||||||
webSocketClientService.connect(endpointId, attributes);
|
webSocketClientService.connect(endpointId, flowFile.getAttributes());
|
||||||
} finally {
|
} finally {
|
||||||
session.remove(flowFile);
|
session.remove(flowFile);
|
||||||
session.commitAsync();
|
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);
|
throw new ProcessException("Failed to register processor to WebSocket service due to: " + e, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else if (context.hasIncomingConnection()) {
|
||||||
try {
|
try {
|
||||||
onWebSocketServiceReady(webSocketService, context);
|
onWebSocketServiceReady(webSocketService, context);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
Loading…
Reference in New Issue