diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2009-03-06 20:26:13 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2009-03-06 20:26:13 +0000 |
| commit | 0c05e3263f265b90afdde25c05d59de62a41fab1 (patch) | |
| tree | 622807c7a78c90dd707873a7fd88be56f97b7761 /qpid/java/client/src/main | |
| parent | 81841c76222bf728b48e645f0368993dcb16856c (diff) | |
| download | qpid-python-0c05e3263f265b90afdde25c05d59de62a41fab1.tar.gz | |
This is related to QPID-1720
The fix is a bit of a hack, but I don't see another way to handle it.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@751061 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/client/src/main')
| -rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/url/URLParser.java | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/url/URLParser.java b/qpid/java/client/src/main/java/org/apache/qpid/client/url/URLParser.java index fab95f754c..f3f74dd332 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/url/URLParser.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/url/URLParser.java @@ -58,22 +58,31 @@ public class URLParser if ((connection.getHost() == null) || connection.getHost().equals("")) { - String uid = AMQConnectionFactory.getUniqueClientID(); - if (uid == null) - { - throw URLHelper.parseError(-1, "Client Name not specified", fullURL); + String tmp = connection.getAuthority(); + // hack to read a clientid such as "my_clientID" + if (tmp != null && tmp.indexOf('@') < tmp.length()-1) + { + _url.setClientName(tmp.substring(tmp.indexOf('@')+1,tmp.length())); } else { - _url.setClientName(uid); + String uid = AMQConnectionFactory.getUniqueClientID(); + if (uid == null) + { + throw URLHelper.parseError(-1, "Client Name not specified", fullURL); + } + else + { + _url.setClientName(uid); + } } - } + } else { _url.setClientName(connection.getHost()); } - + String userInfo = connection.getUserInfo(); if (userInfo == null) |
