File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/main/java/com/rabbitmq/client/amqp/impl Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,7 @@ private NativeConnectionWrapper connect(
270270 LOGGER .debug ("Created native connection instance for '{}'" , this .name ());
271271 ExceptionUtils .wrapGet (connection .openFuture ());
272272 LOGGER .debug ("Connection attempt '{}' succeeded" , this .name ());
273+ checkBroker (connection );
273274 checkBrokerVersion (connection );
274275 return new NativeConnectionWrapper (connection , extractNode (connection ), address );
275276 } catch (ClientException e ) {
@@ -285,6 +286,13 @@ private void sync(NativeConnectionWrapper wrapper) {
285286 this .nativeConnection = wrapper .connection ();
286287 }
287288
289+ private static void checkBroker (org .apache .qpid .protonj2 .client .Connection connection ) throws ClientException {
290+ String broker = (String ) connection .properties ().get ("product" );
291+ if (!"rabbitmq" .equalsIgnoreCase (broker )) {
292+ LOGGER .warn ("Connected to another broker than RabbitMQ ('{}'), the library may not behave as expected" , broker );
293+ }
294+ }
295+
288296 private static void checkBrokerVersion (org .apache .qpid .protonj2 .client .Connection connection )
289297 throws ClientException {
290298 String version = (String ) connection .properties ().get ("version" );
You can’t perform that action at this time.
0 commit comments