exceptionfactory commented on a change in pull request #5398:
URL: https://github.com/apache/nifi/pull/5398#discussion_r735710548
##########
File path:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenRELP.java
##########
@@ -96,27 +100,84 @@
.defaultValue(ClientAuth.REQUIRED.name())
.build();
- private volatile RELPEncoder relpEncoder;
+ public static final Relationship REL_SUCCESS = new Relationship.Builder()
+ .name("success")
+ .description("Messages received successfully will be sent out this
relationship.")
+ .build();
- @Override
- protected List<PropertyDescriptor> getAdditionalProperties() {
- return Arrays.asList(MAX_CONNECTIONS, SSL_CONTEXT_SERVICE,
CLIENT_AUTH);
- }
+ protected List<PropertyDescriptor> descriptors;
+ protected Set<Relationship> relationships;
+ protected volatile int port;
+ protected volatile Charset charset;
+ protected volatile BlockingQueue<RELPMessage> events;
+ protected volatile BlockingQueue<RELPMessage> errorEvents;
+ protected volatile InetAddress hostname;
+ protected EventServer eventServer;
+ protected volatile byte[] messageDemarcatorBytes;
+ protected volatile SSLContext sslContext;
+ protected volatile ClientAuth clientAuth;
+ protected volatile int maxConnections;
+ protected volatile int bufferSize;
Review comment:
Rather than declaring these property-based values as member variables,
it looks like most of them can be method-local and passed to
`RELPMessageServerFactory`.
##########
File path:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenRELP.java
##########
@@ -127,67 +188,31 @@ public void onScheduled(ProcessContext context) throws
IOException {
return results;
}
- @Override
- protected ChannelDispatcher createDispatcher(final ProcessContext context,
final BlockingQueue<RELPEvent> events) throws IOException {
- final EventFactory<RELPEvent> eventFactory = new RELPEventFactory();
- final ChannelHandlerFactory<RELPEvent,AsyncChannelDispatcher>
handlerFactory = new RELPSocketChannelHandlerFactory<>();
-
- final int maxConnections =
context.getProperty(MAX_CONNECTIONS).asInteger();
- final int bufferSize =
context.getProperty(RECV_BUFFER_SIZE).asDataSize(DataUnit.B).intValue();
- final Charset charSet =
Charset.forName(context.getProperty(CHARSET).getValue());
-
- // initialize the buffer pool based on max number of connections and
the buffer size
- final ByteBufferSource byteBufferSource = new
ByteBufferPool(maxConnections, bufferSize);
-
- // if an SSLContextService was provided then create an SSLContext to
pass down to the dispatcher
- SSLContext sslContext = null;
- ClientAuth clientAuth = null;
-
- final SSLContextService sslContextService =
context.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class);
- if (sslContextService != null) {
- final String clientAuthValue =
context.getProperty(CLIENT_AUTH).getValue();
- sslContext = sslContextService.createContext();
- clientAuth = ClientAuth.valueOf(clientAuthValue);
+ private void initializeRelpServer() {
+ final NettyEventServerFactory eventFactory =
getNettyEventServerFactory();
+ eventFactory.setSocketReceiveBuffer(bufferSize);
+ if (sslContext != null) {
+ eventFactory.setSslContext(sslContext);
+ }
Review comment:
When changing from using the SSL Context Service to removing it, the
processor still has the `sslContext` property defined, which means it is not
possible to disable TLS support after configuring an SSL Context Service.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]