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 | 48e760c0778332d2c9f7bb104a14342314763957 (patch) | |
| tree | da2ab47627a947c862050ca929765ccf98293f89 /java/client/src/main | |
| parent | 77a0f0644fba99ea110033412ea232576e7c47f2 (diff) | |
| download | qpid-python-48e760c0778332d2c9f7bb104a14342314763957.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/qpid@751061 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/src/main')
| -rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/url/URLParser.java | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/url/URLParser.java b/java/client/src/main/java/org/apache/qpid/client/url/URLParser.java index fab95f754c..f3f74dd332 100644 --- a/java/client/src/main/java/org/apache/qpid/client/url/URLParser.java +++ b/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) |
