Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.apache.nifi.controller.ConfigurationContext;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.processor.util.StandardValidators;
import org.apache.nifi.reporting.InitializationException;
import org.apache.nifi.ssl.SSLContextService;
import org.apache.nifi.ssl.SSLContextService.ClientAuth;
import org.slf4j.Logger;
Expand Down Expand Up @@ -143,7 +142,9 @@ protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final String
public void resetConnectionFactory(ConnectionFactory cachedFactory) {
if (cachedFactory == connectionFactory) {
getLogger().debug("Resetting connection factory");
connectionFactory = null;
ConfigurationContext context = getConfigurationContext();
this.createConnectionFactoryInstance(context);
this.setConnectionFactoryProperties(context);
}
}

Expand All @@ -160,7 +161,7 @@ public ConnectionFactory getConnectionFactory() {
}

@OnEnabled
public void enable(ConfigurationContext context) throws InitializationException {
public void enable(ConfigurationContext context) {
try {
if (!this.configured) {
if (logger.isInfoEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public void onTrigger(ProcessContext context, ProcessSession session) throws Pro
try {
// Safe to cast. Method #buildTargetResource(ProcessContext context) sets only CachingConnectionFactory
CachingConnectionFactory currentCF = (CachingConnectionFactory)worker.jmsTemplate.getConnectionFactory();
worker.shutdown();
cfProvider.resetConnectionFactory(currentCF.getTargetConnectionFactory());
worker = buildTargetResource(context);
}catch(Exception e) {
Expand Down