qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1570522 - in /qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl: ConnectionFactoryImpl.java ConnectionImpl.java MessageProducerImpl.java
Date Fri, 21 Feb 2014 10:52:21 GMT
Author: rgodfrey
Date: Fri Feb 21 10:52:21 2014
New Revision: 1570522

URL: http://svn.apache.org/r1570522
Log:
QPID-5574 : Allow sync-publish to override default behaviour to make persistent non-tarnsacted
messages non-synchronous

Modified:
    qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionFactoryImpl.java
    qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java
    qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java

Modified: qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionFactoryImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionFactoryImpl.java?rev=1570522&r1=1570521&r2=1570522&view=diff
==============================================================================
--- qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionFactoryImpl.java
(original)
+++ qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionFactoryImpl.java
Fri Feb 21 10:52:21 2014
@@ -58,7 +58,7 @@ public class ConnectionFactoryImpl imple
     private String _queuePrefix;
     private String _topicPrefix;
     private boolean _useBinaryMessageId = Boolean.parseBoolean(System.getProperty("qpid.use_binary_message_id",
"true"));
-    private boolean _syncPublish = Boolean.parseBoolean(System.getProperty("qpid.sync_publish",
"false"));
+    private Boolean _syncPublish;
     private int _maxSessions = Integer.getInteger("qpid.max_sessions", 0);
     private int _maxPrefetch;
     private String _keyStorePath;
@@ -138,6 +138,10 @@ public class ConnectionFactoryImpl imple
         _remoteHost = remoteHost;
         _ssl = ssl;
         _maxSessions = maxSessions;
+        if(! "".equals(System.getProperty("qpid.sync_publish","")))
+        {
+            _syncPublish = Boolean.getBoolean("qpid.sync_publish");
+        }
     }
 
     public ConnectionImpl createConnection() throws JMSException
@@ -239,7 +243,7 @@ public class ConnectionFactoryImpl imple
         String remoteHost;
 
         boolean binaryMessageId = true;
-        boolean syncPublish;
+        Boolean syncPublish;
         int maxSessions;
         public boolean ssl;
         public int maxPrefetch;
@@ -539,7 +543,7 @@ public class ConnectionFactoryImpl imple
         _useBinaryMessageId = useBinaryMessageId;
     }
 
-    public void setSyncPublish(boolean syncPublish)
+    public void setSyncPublish(Boolean syncPublish)
     {
         _syncPublish = syncPublish;
     }

Modified: qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java?rev=1570522&r1=1570521&r2=1570522&view=diff
==============================================================================
--- qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java
(original)
+++ qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java
Fri Feb 21 10:52:21 2014
@@ -62,7 +62,7 @@ public class ConnectionImpl implements C
     private String _queuePrefix;
     private String _topicPrefix;
     private boolean _useBinaryMessageId = Boolean.parseBoolean(System.getProperty("qpid.use_binary_message_id",
"true"));
-    private boolean _syncPublish = Boolean.parseBoolean(System.getProperty("qpid.sync_publish",
"false"));
+    private Boolean _syncPublish;
     private int _maxSessions;
     private int _maxPrefetch;
 
@@ -141,6 +141,11 @@ public class ConnectionImpl implements C
         _remoteHost = remoteHost;
         _sslContext = sslContext;
         _maxSessions = maxSessions;
+
+        if(! "".equals(System.getProperty("qpid.sync_publish","")))
+        {
+            _syncPublish = Boolean.getBoolean("qpid.sync_publish");
+        }
     }
 
     private void connect() throws JMSException
@@ -629,12 +634,12 @@ public class ConnectionImpl implements C
         return _useBinaryMessageId;
     }
 
-    void setSyncPublish(boolean syncPublish)
+    void setSyncPublish(Boolean syncPublish)
     {
         _syncPublish = syncPublish;
     }
 
-    boolean syncPublish()
+    Boolean syncPublish()
     {
         return _syncPublish;
     }

Modified: qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java?rev=1570522&r1=1570521&r2=1570522&view=diff
==============================================================================
--- qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java
(original)
+++ qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java
Fri Feb 21 10:52:21 2014
@@ -55,12 +55,14 @@ public class MessageProducerImpl impleme
     private SessionImpl _session;
     private Sender _sender;
     private boolean _closed;
-    private boolean _syncPublish = Boolean.getBoolean("qpid.sync_publish");
+    private Boolean _syncPublish;
+
     private long _syncPublishTimeout = Long.getLong("qpid.sync_publish_timeout", 30000l);
 
     protected MessageProducerImpl(final Destination destination,
                                final SessionImpl session) throws JMSException
     {
+
         if(destination instanceof DestinationImpl)
         {
             _destination = (DestinationImpl) destination;
@@ -305,7 +307,10 @@ public class MessageProducerImpl impleme
         final org.apache.qpid.amqp_1_0.client.Message clientMessage = new org.apache.qpid.amqp_1_0.client.Message(msg.getSections());
 
         DispositionAction action = null;
-        final boolean doSync = _syncPublish || (deliveryMode == DeliveryMode.PERSISTENT &&
_session.getTxn() == null);
+        final boolean doSync = Boolean.TRUE.equals(_syncPublish)
+                               || (deliveryMode == DeliveryMode.PERSISTENT
+                                   && _session.getTxn() == null
+                                   && !Boolean.FALSE.equals(_syncPublish));
         if(doSync)
         {
             action = new DispositionAction(_sender);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message