karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject git commit: [KARAF-2549] Fix JMS connection startup
Date Thu, 19 Dec 2013 13:18:19 GMT
Updated Branches:
  refs/heads/master 6487cfdc4 -> ab106515a


[KARAF-2549] Fix JMS connection startup


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

Branch: refs/heads/master
Commit: ab106515a5a7a62483a399cd48b3364668585b7c
Parents: 6487cfd
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Thu Dec 19 14:17:57 2013 +0100
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Thu Dec 19 14:17:57 2013 +0100

----------------------------------------------------------------------
 .../java/org/apache/karaf/jms/internal/JmsServiceImpl.java   | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/ab106515/jms/core/src/main/java/org/apache/karaf/jms/internal/JmsServiceImpl.java
----------------------------------------------------------------------
diff --git a/jms/core/src/main/java/org/apache/karaf/jms/internal/JmsServiceImpl.java b/jms/core/src/main/java/org/apache/karaf/jms/internal/JmsServiceImpl.java
index 5f525a2..5de89a5 100644
--- a/jms/core/src/main/java/org/apache/karaf/jms/internal/JmsServiceImpl.java
+++ b/jms/core/src/main/java/org/apache/karaf/jms/internal/JmsServiceImpl.java
@@ -108,6 +108,7 @@ public class JmsServiceImpl implements JmsService {
         try {
             ConnectionFactory cf = (ConnectionFactory) bundleContext.getService(reference);
             connection = cf.createConnection(username, password);
+            connection.start();
             ConnectionMetaData metaData = connection.getMetaData();
             map.put("product", metaData.getJMSProviderName());
             map.put("version", metaData.getProviderVersion());
@@ -130,6 +131,7 @@ public class JmsServiceImpl implements JmsService {
         try {
             ConnectionFactory cf = (ConnectionFactory) bundleContext.getService(reference);
             connection = cf.createConnection(username, password);
+            connection.start();
             session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             QueueBrowser browser = session.createBrowser(session.createQueue(destination));
             Enumeration<Message> enumeration = browser.getEnumeration();
@@ -161,6 +163,7 @@ public class JmsServiceImpl implements JmsService {
         try {
             ConnectionFactory cf = (ConnectionFactory) bundleContext.getService(reference);
             connection = cf.createConnection(username, password);
+            connection.start();
             if (connection instanceof PooledConnection) {
                 connection = ((PooledConnection) connection).getConnection();
             }
@@ -190,6 +193,7 @@ public class JmsServiceImpl implements JmsService {
         try {
             ConnectionFactory cf = (ConnectionFactory) bundleContext.getService(reference);
             connection = cf.createConnection(username, password);
+            connection.start();
             if (connection instanceof PooledConnection) {
                 connection = ((PooledConnection) connection).getConnection();
             }
@@ -220,6 +224,7 @@ public class JmsServiceImpl implements JmsService {
         try {
             ConnectionFactory cf = (ConnectionFactory) bundleContext.getService(reference);
             connection = cf.createConnection(username, password);
+            connection.start();
             session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             QueueBrowser browser = session.createBrowser(session.createQueue(queue), filter);
             Enumeration<Message> enumeration = browser.getEnumeration();
@@ -250,6 +255,7 @@ public class JmsServiceImpl implements JmsService {
         try {
             ConnectionFactory cf = (ConnectionFactory) bundleContext.getService(reference);
             connection = cf.createConnection(username, password);
+            connection.start();
             session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             Message message = session.createTextMessage(body);
             if (replyTo != null) {
@@ -280,6 +286,7 @@ public class JmsServiceImpl implements JmsService {
         try {
             ConnectionFactory cf = (ConnectionFactory) bundleContext.getService(reference);
             connection = cf.createConnection(username, password);
+            connection.start();
             session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             MessageConsumer consumer = session.createConsumer(session.createQueue(queue),
selector);
             Message message;
@@ -312,6 +319,7 @@ public class JmsServiceImpl implements JmsService {
         try {
             ConnectionFactory cf = (ConnectionFactory) bundleContext.getService(reference);
             connection = cf.createConnection(username, password);
+            connection.start();
             session = connection.createSession(true, Session.SESSION_TRANSACTED);
             MessageConsumer consumer = session.createConsumer(session.createQueue(sourceQueue),
selector);
             Message message;


Mime
View raw message