2

我正在使用 Mule Studio 3.4 并想尝试使用 Active Mq。我知道 ActiveMq 嵌入在 Mule 中,因此没有必要在类路径中添加 jar,顺便说在类路径中找不到 activeMq 类。我哪里错了?这是我的配置(从http://www.mulesoft.org/mule-activemq-integration-examples复制):

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
    xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd">
    <spring:beans>
    <spring:bean id="AmqDeadLetterStrategy"
                 class="org.apache.activemq.broker.region.policy.IndividualDeadLetterStrategy"
                 p:queuePrefix="DLQ." />

    <spring:bean id="AmqDefaultPolicyEntry"
                 class="org.apache.activemq.broker.region.policy.PolicyEntry"
                 p:queue="jobs.*"
                 p:deadLetterStrategy-ref="AmqDeadLetterStrategy" />

    <spring:bean id="AmqPolicyMap"
                 class="org.apache.activemq.broker.region.policy.PolicyMap"
                 p:defaultEntry-ref="AmqDefaultPolicyEntry" />

    <spring:bean name="AmqBroker"
                 class="org.apache.activemq.broker.BrokerService"
                 p:brokerName="esb-amq-broker"
                 p:persistent="true"
                 p:dataDirectory="${activemq.data.dir}"
                 p:useJmx="true"
                 p:useShutdownHook="false"
                 p:destinationPolicy-ref="AmqPolicyMap"
                 init-method="start"
                 destroy-method="stop" />

    <spring:bean name="AmqRedeliveryPolicy"
                 class="org.apache.activemq.RedeliveryPolicy"
                 p:useExponentialBackOff="true" />

    <spring:bean name="AmqConnectionFactory"
                 class="org.apache.activemq.spring.ActiveMQConnectionFactory"
                 p:brokerURL="vm://esb-amq-broker"
                 p:redeliveryPolicy-ref="AmqRedeliveryPolicy"
                 depends-on="AmqBroker" />
  </spring:beans>

  <jms:activemq-connector name="EsbJmsConnector"
                          specification="1.1"
                          connectionFactory-ref="AmqConnectionFactory"
                          disableTemporaryReplyToDestinations="true"
                          persistentDelivery="true" />

</mule>

错误是“无法在项目的构建路径上找到类型 org.apache.activemq.broker.region.policy.IndividualDeadLetterStrategy ...”和类似的其他错误。谢谢!

4

1 回答 1

4

Mule 不捆绑 activemq jar,也不捆绑任何 JMS 代理,因此您需要手动将其添加到您的项目中,或者${studio.home}/plugins/org.mule.tooling.server.${mule.version}_${mule.version}.${time.stamp}/mule/user如果您希望容器提供它。

于 2013-09-09T11:06:41.837 回答