Permalink
Browse files

allow response queue for JMS agent to be disabled

  • Loading branch information...
ssadedin committed Jan 9, 2018
1 parent 310917a commit 453f9b0742844e769b5e11140334a0f7318ddfba
Showing with 17 additions and 5 deletions.
  1. +2 −0 src/main/groovy/bpipe/Utils.groovy
  2. +15 −5 src/main/groovy/bpipe/agent/JMSAgent.groovy
@@ -1036,6 +1036,8 @@ class Utils {
}
static closeQuietly(obj) {
if(obj == null)
return
try {
obj.close()
}
@@ -154,9 +154,6 @@ class JMSAgent extends Agent {
if(!(config.containsKey('commandQueue')))
throw new PipelineError("ActiveMQ configuration is missing required key 'queue'")
if(!(config.containsKey('responseQueue')))
throw new PipelineError("ActiveMQ configuration is missing required key 'responseQueue'")
log.info "Connecting to: ${config.brokerURL}"
this.connection = new ActiveMQConnectionFactory(brokerURL: config.brokerURL).createConnection()
@@ -170,8 +167,21 @@ class JMSAgent extends Agent {
@Override
public WorxConnection createConnection() {
Queue queue = this.session.createQueue(config.responseQueue)
return new JMSWorxConnection(queue, session)
if(config.containsKey('responseQueue')) {
Queue queue = this.session.createQueue(config.responseQueue)
return new JMSWorxConnection(queue, session)
}
else {
// Create a dummy connection that does not send anything
return new WorxConnection() {
void sendJson(String path, String json) {}
Object readResponse() { [:] }
void close() { }
}
}
}
}

0 comments on commit 453f9b0

Please sign in to comment.