diff options
| author | Gordon Sim <gsim@apache.org> | 2010-11-10 16:51:16 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2010-11-10 16:51:16 +0000 |
| commit | ab65488008895376c5f74ead6d1cc5d2568fd8a5 (patch) | |
| tree | 76790c4c0757bd704ba842c611e02d069c84d4e2 /cpp/src/qpid | |
| parent | 9071df0ec8ac19dfa486808249286b8428162781 (diff) | |
| download | qpid-python-ab65488008895376c5f74ead6d1cc5d2568fd8a5.tar.gz | |
Fix to r1028346: no point in throwing exception after queue has already been created, so just log error and revert to default (do this for floating point values also)
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1033585 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
| -rw-r--r-- | cpp/src/qpid/broker/QueuePolicy.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/cpp/src/qpid/broker/QueuePolicy.cpp b/cpp/src/qpid/broker/QueuePolicy.cpp index c1d979ac33..f311ea8321 100644 --- a/cpp/src/qpid/broker/QueuePolicy.cpp +++ b/cpp/src/qpid/broker/QueuePolicy.cpp @@ -123,17 +123,23 @@ uint32_t QueuePolicy::getCapacity(const FieldTable& settings, const std::string& int32_t result = 0; if (!v) return defaultValue; - if (v->convertsTo<int>()) { + if (v->getType() == 0x23) { + QPID_LOG(debug, "Value for " << key << " specified as float: " << v->get<float>()); + } else if (v->getType() == 0x33) { + QPID_LOG(debug, "Value for " << key << " specified as double: " << v->get<double>()); + } else if (v->convertsTo<int>()) { result = v->get<int>(); + QPID_LOG(debug, "Got integer value for " << key << ": " << result); if (result >= 0) return result; - } - else { - string s(v->get<string>()); // I assume anything can be converted to a string + } else if (v->convertsTo<string>()) { + string s(v->get<string>()); + QPID_LOG(debug, "Got string value for " << key << ": " << s); std::istringstream convert(s); if (convert >> result && result >= 0) return result; } - throw InvalidArgumentException(QPID_MSG("Cannot convert " << key << " to unsigned integer")); + QPID_LOG(warning, "Cannot convert " << key << " to unsigned integer, using default (" << defaultValue << ")"); + return defaultValue; } std::string QueuePolicy::getType(const FieldTable& settings) |
