0
我正在开发一个项目,我们决定添加一些使用jms和hornetq作为提供者的交互。
我对骆驼相当陌生,所以遇到一些问题,如果你可能指的是微不足道的。
目标是初始化连接工厂并添加jms组件。但是,据我所知,它不能直接在路由配置器中完成。所以我创建了camel-config.xml并将其放置到resources /目录。
我以下列方式填充它:在模式中找不到任何组件:jms
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>
<prop key="java.naming.provider.url">jnp://localhost:1099</prop>
<prop key="java.naming.factory.url.pkgs">org.jnp.interfaces:org.jboss.naming</prop>
</props>
</property>
</bean>
<bean id="jmsQueueConnectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate">
<ref bean="jndiTemplate"/>
</property>
<property name="jndiName">
<value>ConnectionFactory</value>
</property>
</bean>
<bean name="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory" ref="jmsQueueConnectionFactory"/>
</bean>
</beans>
项目不使用Spring所以它是XML我发现,不使用弹簧的唯一的例子。 在路线配置器我用routeBuilder.from("jms:queue:top").to("...");
然而,当我开始它抛出FailedToCreateEndpointException并指出
“与架构没有找到组件:JMS”项目。
我想这个xml文件根本就没有用过,但我无法理解如何指向它。期待听到任何建议。
这实际上*是*使用Spring,正如彼得说,它需要被引导或替换。但是,在其他任何事情之前,请确认您实际上是否添加了camel-jms依赖项。这是您错过类路径中的组件时所遇到的错误类型。 – kaqqao 2014-09-29 17:37:11