You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Boot应用连接云端ActiveMQ Artemis 2.17失败求助

Spring Boot连接云端ActiveMQ Artemis 2.17失败,本地2.9正常

我的Java Spring Boot应用能正常连接本地ActiveMQ Artemis 2.9版本,但连接云端ActiveMQ Artemis 2.17版本时连接失败。不过我可以访问远程控制台,并且能执行浏览、发送等所有操作,说明远程服务是可达的。

从日志中可见,应用初始连接成功后抛出异常:

org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException: AMQ219006: Channel disconnected

以下是部分日志内容:

DEBUG [main] Connector NettyConnector [host=********, port=61617, httpEnabled=false, httpUpgradeEnabled=false, useServlet=false, servletPath=/messaging/ActiveMQServlet, sslEnabled=false, useNio=true] using nio
DEBUG [main] Started NIO Netty Connector version 4.1.104.Final to ********:61617
DEBUG [main] Remote destination: ********:61617
DEBUG [main] -Dio.netty.processId: 33688 (auto-detected)
DEBUG [main] -Djava.net.preferIPv4Stack: false
DEBUG [main] -Djava.net.preferIPv6Addresses: false
DEBUG [main] Loopback interface: lo (Software Loopback Interface 1, 127.0.0.1)
DEBUG [main] Failed to get SOMAXCONN from sysctl and file \proc\sys\net\core\somaxconn. Default: 200
DEBUG [main] -Dio.netty.machineId: 00:05:9a:ff:fe:3c:7a:00 (auto-detected)
DEBUG [main] -Dio.netty.allocator.numHeapArenas: 32
DEBUG [main] -Dio.netty.allocator.numDirectArenas: 32
DEBUG [main] -Dio.netty.allocator.pageSize: 8192
DEBUG [main] -Dio.netty.allocator.maxOrder: 9
DEBUG [main] -Dio.netty.allocator.chunkSize: 4194304
DEBUG [main] -Dio.netty.allocator.smallCacheSize: 256
DEBUG [main] -Dio.netty.allocator.normalCacheSize: 64
DEBUG [main] -Dio.netty.allocator.maxCachedBufferCapacity: 32768
DEBUG [main] -Dio.netty.allocator.cacheTrimInterval: 8192
DEBUG [main] -Dio.netty.allocator.cacheTrimIntervalMillis: 0
DEBUG [main] -Dio.netty.allocator.useCacheForAllThreads: false
DEBUG [main] -Dio.netty.allocator.maxCachedByteBuffersPerChunk: 1023
DEBUG [main] -Dio.netty.allocator.type: pooled
DEBUG [main] -Dio.netty.threadLocalDirectBufferSize: 0
DEBUG [main] -Dio.netty.maxThreadLocalCharBufferSize: 16384
DEBUG [main] -Dio.netty.bootstrap.extensions: null
DEBUG [Thread-0 (ActiveMQ-client-netty-threads)] Added ActiveMQClientChannelHandler to Channel with id = 73c752b3 
DEBUG [main] Connected with the currentConnectorConfig=TransportConfiguration(name=null, factory=org-apache-activemq-artemis-core-remoting-impl-netty-NettyConnectorFactory) ?port=61617&host=********
DEBUG [main] -Dio.netty.buffer.checkAccessible: true
DEBUG [main] -Dio.netty.buffer.checkBounds: true
DEBUG [main] Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@5f61e002
DEBUG [main] -Dio.netty.recycler.maxCapacityPerThread: 4096
DEBUG [main] -Dio.netty.recycler.ratio: 8
DEBUG [main] -Dio.netty.recycler.chunkSize: 32
DEBUG [main] -Dio.netty.recycler.blocking: false
DEBUG [main] -Dio.netty.recycler.batchFastThreadLocalOnly: true
DEBUG [main] Reconnection successful
DEBUG [main] ClientSessionFactoryImpl received backup update for live/backup pair = TransportConfiguration(name=null, factory=org-apache-activemq-artemis-core-remoting-impl-netty-NettyConnectorFactory) ?port=61617&host=******** / null  but it didn't belong to TransportConfiguration(name=null, factory=org-apache-activemq-artemis-core-remoting-impl-netty-NettyConnectorFactory) ?port=61617&host=********
DEBUG [Thread-0 (ActiveMQ-client-global-threads)] Failure captured on connectionID=73c752b3, performing failover or reconnection now
org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException: AMQ219006: Channel disconnected
    at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.connectionDestroyed(ClientSessionFactoryImpl.java:410)
    at org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector$Listener$1.run(NettyConnector.java:1240)
    at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:57)
    at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:32)
    at org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:68)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)

pom.xml配置如下:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.2.1</version>
        <relativePath/>
    </parent>

    <groupId>***</groupId>
    <artifactId>***</artifactId>
    <version>1.0.0</version>
    <name>***</name>
    <description>***</description>

    <properties>
        <maven.compiler.target>17</maven.compiler.target>
        <maven.compiler.source>17</maven.compiler.source>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>                                       
            </plugin>                   
        </plugins>
    </build>
    
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>    
        </dependency>         
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-artemis</artifactId>
        </dependency>
    
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-core</artifactId>
        </dependency>
    </dependencies>
</project>

我尝试过更换另一个云端ActiveMQ Artemis实例,结果相同;还专门创建了独立测试项目,问题依旧。

内容的提问来源于stack exchange,提问作者Matusevich Elena

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.26 06:07:02