Skip to content

Commit 581a1f4

Browse files
committed
Be more lenient when parsing broker version
1 parent d9f5387 commit 581a1f4

File tree

1 file changed

+12
-2
lines changed
  • src/main/java/com/rabbitmq/client/amqp/impl

1 file changed

+12
-2
lines changed

src/main/java/com/rabbitmq/client/amqp/impl/Utils.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,21 @@ static int versionCompare(String str1, String str2) {
222222
}
223223

224224
static boolean is4_0_OrMore(String brokerVersion) {
225-
return versionCompare(currentVersion(brokerVersion), "4.0.0") >= 0;
225+
try {
226+
return versionCompare(currentVersion(brokerVersion), "4.0.0") >= 0;
227+
} catch (Exception e) {
228+
LOGGER.debug("Unable to parse broker version {}", brokerVersion, e);
229+
return true;
230+
}
226231
}
227232

228233
static boolean is4_1_OrMore(String brokerVersion) {
229-
return versionCompare(currentVersion(brokerVersion), "4.1.0") >= 0;
234+
try {
235+
return versionCompare(currentVersion(brokerVersion), "4.1.0") >= 0;
236+
} catch (Exception e) {
237+
LOGGER.debug("Unable to parse broker version {}", brokerVersion, e);
238+
return true;
239+
}
230240
}
231241

232242
static boolean supportFilterExpressions(String brokerVersion) {

0 commit comments

Comments
 (0)