Author: rajith
Date: Wed Oct  1 12:27:19 2008
New Revision: 700886

URL: http://svn.apache.org/viewvc?rev=700886&view=rev
Log:
This is in response to Rafis comments on QPID-943.
The userid is now converted into bytes using the UTF-8 encoding and the result 
is cached.

Modified:
    
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java

Modified: 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java?rev=700886&r1=700885&r2=700886&view=diff
==============================================================================
--- 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
 (original)
+++ 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
 Wed Oct  1 12:27:19 2008
@@ -35,6 +35,7 @@
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.BasicContentHeaderProperties;
 import org.apache.qpid.url.AMQBindingURL;
+import org.apache.qpid.util.Strings;
 import org.apache.qpid.nclient.util.ByteBufferMessage;
 import org.apache.qpid.njms.ExceptionHelper;
 import org.apache.qpid.transport.*;
@@ -45,6 +46,7 @@
  */
 public class BasicMessageProducer_0_10 extends BasicMessageProducer
 {
+    private byte[] userIDBytes;
 
     BasicMessageProducer_0_10(AMQConnection connection, AMQDestination 
destination, boolean transacted, int channelId,
                               AMQSession session, AMQProtocolHandler 
protocolHandler, long producerId,
@@ -52,6 +54,8 @@
     {
         super(connection, destination, transacted, channelId, session, 
protocolHandler, producerId, immediate,
               mandatory, waitUntilSent);
+        
+        userIDBytes = Strings.toUTF8(_userID);
     }
 
     void declareDestination(AMQDestination destination)
@@ -78,7 +82,7 @@
         MessageProperties messageProps = delegate.getMessageProperties();
 
         // On the receiving side, this will be read in to the JMSXUserID as 
well.
-        messageProps.setUserId(_userID.getBytes());
+        messageProps.setUserId(userIDBytes);
                 
         if (messageId != null)
         {


Reply via email to