Skip to content

Commit 5d280f5

Browse files
committed
fix regression from previous fix causing error in connection initialisation
1 parent e8f392c commit 5d280f5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main/groovy/bpipe/notification/ActivemqNotificationChannel.groovy

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import groovy.json.JsonSlurper
66
import org.apache.activemq.ActiveMQConnection
77

88
import org.apache.activemq.ActiveMQConnectionFactory
9+
import org.apache.activemq.ThreadPriorities
10+
import org.apache.activemq.thread.TaskRunnerFactory
911

1012
import bpipe.*
1113

@@ -54,11 +56,15 @@ class ActivemqNotificationChannel extends JMSNotificationChannel {
5456

5557

5658
def connectionFactory = new ActiveMQConnectionFactory(brokerURL: config.brokerURL)
57-
59+
60+
def taskRunnerFactory =
61+
new TaskRunnerFactory("ActiveMQ Session Task", ThreadPriorities.INBOUND_CLIENT_SESSION, false, 1000, false, 4)
62+
5863
// The recommendation is that this be left false to allow for failover, message retry etc to execute
5964
// even if the JVM is shutting down. However it causes Bpipe to hang at shutdown under certain conditions
6065
// which is problematic for scenarios where it is run automated / unattended
61-
connectionFactory.sessionTaskRunner?.setDaemon(true)
66+
taskRunnerFactory.setDaemon(true)
67+
connectionFactory.setSessionTaskRunner(taskRunnerFactory)
6268

6369
if (config.containsKey('username') && config.containsKey('credentialsJsonFile')) {
6470
throw new PipelineError("ActiveMQ configuration username and credentialsJsonFile are mutually exclusive, please only provide one or the other")

0 commit comments

Comments
 (0)