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

ActiveMQ Artemis桥接配置无效问题排查求助

问题:ActiveMQ Artemis 2.29.0桥接配置启动报错

配置的XML片段:

<bridge name="myBridge">
  <queue-name>jms.topic.my.special.queue</queue-name>
  <reconnect-attempts>-1</reconnect-attempts>
  <static-connectors>
    <connector-ref>kit1-connector1</connector-ref>
    <connector-ref>kit2-connector1</connector-ref>
    <connector-ref>kit3-connector1</connector-ref>
  </static-connectors>
</bridge>

启动时错误:

Caused by: org.xml.sax.SAXParseException; cvc-complex-type.2.4.a: Invalid content was found starting with element '{"urn:activemq:core":bridge}'. One of '{"urn:activemq:core":system-property-prefix, "urn:activemq:core":internal-naming-prefix, "urn:activemq:core":amqp-use-core-subscription-naming, "urn:activemq:core":resolve-protocols, "urn:activemq:core":scheduled-thread-pool-max-size, "urn:activemq:core":thread-pool-max-size, "urn:activemq:core":graceful-shutdown-enabled, "urn:activemq:core":graceful-shutdown-timeout, "urn:activemq:core":security-enabled, "urn:activemq:core":security-invalidation-interval, "urn:activemq:core":authentication-cache-size, "urn:activemq:core":authorization-cache-size, "urn:activemq:core":journal-lock-acquisition-timeout, "urn:activemq:core":wild-card-routing-enabled, "urn:activemq:core":management-address, "urn:activemq:core":management-notification-address, "urn:activemq:core":cluster-user, "urn:activemq:core":cluster-password, "urn:activemq:core":password-codec, "urn:activemq:core":mask-password, "urn:activemq:core":log-delegate-factory-class-name, "urn:activemq:core":jmx-management-enabled, "urn:activemq:core":jmx-domain, "urn:activemq:core":jmx-use-broker-name, "urn:activemq:core":message-counter-enabled, "urn:activemq:core":message-counter-sample-period, "urn:activemq:core":message-counter-max-day-history, "urn:activemq:core":connection-ttl-override, "urn:activemq:core":connection-ttl-check-interval, "urn:activemq:core":configuration-file-refresh-period, "urn:activemq:core":temporary-queue-namespace, "urn:activemq:core":async-connection-execution-enabled, "urn:activemq:core":transaction-timeout, "urn:activemq:core":transaction-timeout-scan-period, "urn:activemq:core":message-expiry-thread-priority, "urn:activemq:core":address-queue-scan-period, "urn:activemq:core":id-cache-size, "urn:activemq:core":persist-id-cache, "urn:activemq:core":remoting-incoming-interceptors, "urn:activemq:core":remoting-outgoing-interceptors, "urn:activemq:core":persist-delivery-count-before-delivery, "urn:activemq:core":populate-validated-user, "urn:activemq:core":reject-empty-validated-user, "urn:activemq:core":mqtt-session-scan-interval, "urn:activemq:core":broadcast-groups, "urn:activemq:core":discovery-groups, "urn:activemq:core":diverts, "urn:activemq:core":queues, "urn:activemq:core":bridges, "urn:activemq:core":federations, "urn:activemq:core":ha-policy, "urn:activemq:core":cluster-connections, "urn:activemq:core":broker-connections, "urn:activemq:core":connection-routers, "urn:activemq:core":grouping-handler, "urn:activemq:core":create-bindings-dir, "urn:activemq:core":page-max-concurrent-io, "urn:activemq:core":read-whole-page, "urn:activemq:core":journal-retention-directory, "urn:activemq:core":node-manager-lock-directory, "urn:activemq:core":create-journal-dir, "urn:activemq:core":journal-buffer-timeout, "urn:activemq:core":journal-buffer-size, "urn:activemq:core":journal-sync-transactional, "urn:activemq:core":journal-sync-non-transactional, "urn:activemq:core":log-journal-write-rate, "urn:activemq:core":journal-compact-percentage, "urn:activemq:core":journal-compact-min-files, "urn:activemq:core":journal-file-open-timeout, "urn:activemq:core":server-dump-interval, "urn:activemq:core":global-max-messages, "urn:activemq:core":global-max-size, "urn:activemq:core":memory-warning-threshold, "urn:activemq:core":memory-measure-interval, "urn:activemq:core":store, "urn:activemq:core":page-sync-timeout, "urn:activemq:core":suppress-session-notifications, "urn:activemq:core":broker-plugins, "urn:activemq:core":metrics-plugin, "urn:activemq:core":metrics, "urn:activemq:core":resource-limit-settings, "urn:activemq:core":connector-services, "urn:activemq:core":network-check-list, "urn:activemq:core":network-check-URL-list, "urn:activemq:core":network-check-period, "urn:activemq:core":network-check-timeout, "urn:activemq:core":network-check-NIC, "urn:activemq:core":network-check-ping-command, "urn:activemq:core":network-check-ping6-command, "urn:activemq:core":wildcard-addresses}' is expected.

问题原因及解决方案

你的<bridge>节点直接作为核心配置的子元素,但ActiveMQ Artemis的XML schema要求所有桥接配置必须嵌套在<bridges>父节点内部,不能单独存在。错误信息里也明确列出了期望的元素包含{"urn:activemq:core":bridges},这是关键提示。

修正后的配置示例:

<bridges>
  <bridge name="myBridge">
    <queue-name>jms.topic.my.special.queue</queue-name>
    <reconnect-attempts>-1</reconnect-attempts>
    <static-connectors>
      <connector-ref>kit1-connector1</connector-ref>
      <connector-ref>kit2-connector1</connector-ref>
      <connector-ref>kit3-connector1</connector-ref>
    </static-connectors>
  </bridge>
</bridges>

将原<bridge>节点放入<bridges>容器中,即可解决XML schema校验失败的问题。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.17 10:37:50