summaryrefslogtreecommitdiff
path: root/java
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
commit656b95438af9400a08d0813bd9af4adea885fbf4 (patch)
tree99fa44e03c4d52ed811760d1651dffe4b6136629 /java
parentd03ab78a2b5f1a36f8212289de42d3425ba3e7b2 (diff)
downloadqpid-python-656b95438af9400a08d0813bd9af4adea885fbf4.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/qpid@700886 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java b/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
index 2810b37d48..ef8aeb58a1 100644
--- a/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
+++ b/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)
{