You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2014/10/17 20:37:04 UTC

git commit: checking whether channel is opne

Repository: airavata
Updated Branches:
  refs/heads/master 97e94d9d5 -> cb94631e3


checking whether channel is opne


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/cb94631e
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/cb94631e
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/cb94631e

Branch: refs/heads/master
Commit: cb94631e32a10a66e0986f45454fe50d29419fd2
Parents: 97e94d9
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Fri Oct 17 14:36:59 2014 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Fri Oct 17 14:36:59 2014 -0400

----------------------------------------------------------------------
 .../apache/airavata/messaging/core/impl/RabbitMQConsumer.java    | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/cb94631e/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQConsumer.java
----------------------------------------------------------------------
diff --git a/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQConsumer.java b/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQConsumer.java
index 3bd9d02..84d4b43 100644
--- a/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQConsumer.java
+++ b/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQConsumer.java
@@ -114,6 +114,10 @@ public class RabbitMQConsumer implements Consumer {
             String queueName = (String) props.get(MessagingConstants.RABBIT_QUEUE);
             String consumerTag = (String) props.get(MessagingConstants.RABBIT_CONSUMER_TAG);
             if (queueName == null) {
+                if (!channel.isOpen()) {
+                    channel = connection.createChannel();
+                    channel.exchangeDeclare(exchangeName, "topic", false);
+                }
                 queueName = channel.queueDeclare().getQueue();
             } else {
                 channel.queueDeclare(queueName, true, false, false, null);