summaryrefslogtreecommitdiff
path: root/qpid
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2008-10-01 19:27:19 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2008-10-01 19:27:19 +0000
commitdd2ed172b017cae24354bb0b7be9bd1f44249f3d (patch)
tree8cd4a4f0e41dfeed187f37d328369f129e649ae9 /qpid
parent45e2225e7dd7d7e2ebdaaee0f7a74e794a0603ba (diff)
downloadqpid-python-dd2ed172b017cae24354bb0b7be9bd1f44249f3d.tar.gz
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. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@700886 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid')
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java b/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
index 2810b37d48..ef8aeb58a1 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
@@ -35,6 +35,7 @@ import org.apache.qpid.client.protocol.AMQProtocolHandler;
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 @@ import static org.apache.qpid.transport.Option.*;
*/
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 @@ public class BasicMessageProducer_0_10 extends BasicMessageProducer
{
super(connection, destination, transacted, channelId, session, protocolHandler, producerId, immediate,
mandatory, waitUntilSent);
+
+ userIDBytes = Strings.toUTF8(_userID);
}
void declareDestination(AMQDestination destination)
@@ -78,7 +82,7 @@ public class BasicMessageProducer_0_10 extends BasicMessageProducer
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)
{