我是骆驼和活跃mq的新手。我正在使用jboss保险丝,我已经在保险丝控制台中创建了一个队列,我在jboss开发者工作室中使用osgi制作了驼色蓝图。在蓝图中我有sls csv记录并将记录的逐个发送到队列。但我得到connectionFactory必须指定错误。任何人都可以修理我吗?
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:blueprint="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/blueprint"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<bean id="transactionManager"
class=
"org.springframework.jms.connection.JmsTransactionManager">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
</bean>
<bean id="jmsConnectionFactory" class=
"org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value=
"tcp://IYC6ITDT1:61616?maximumConnections=1000"/>
</bean>
<bean class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
<property name="transactionManager" ref="transactionManager"/>
<property name="transacted" value="true"/>
</bean>
<camelContext trace="false" id="blueprintContext" xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="file:C:/Users/thomasalbert/workspace/uyirnokkam/input"/>
<unmarshal>
<beanio mapping="isha/mdm/uyn/participant-datamapping.xml" streamName="participantFile"/>
</unmarshal>
<split>
<simple>${body}</simple>
<marshal>
<json library="Jackson"/>
</marshal>
<convertBodyTo type="java.lang.String"/>
<log message="This is the JSON record: ${body}"/>
<to uri="jms:queue:Thomas"/>
</split>
</route>
</camelContext>
</blueprint>
答案 0 :(得分:0)
对于未定义的jmsComponent bean id,请将id设为&#34; jms&#34;如下图所示
<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
<property name="transactionManager" ref="transactionManager"/>
<property name="transacted" value="true"/>
</bean>
此外,此ID用于访问以下行中的队列
<to uri="jms:queue:Thomas"/>
因此,如果bean id为&#34; sampleJMS&#34;,则端点将更改为&#34; sampleJMS:queue:Thomas&#34;
这应解决当前错误,但您的代码中还会出现更多错误。
示例:maximumConnections不能作为brokerUrl中的参数传递,而是将其作为参数传递给PooledConnectionFactory,如http://camel.apache.org/activemq.html#ActiveMQ-Usingconnectionpooling中所述