[rabbitmq-discuss] Polling message from RabbitMQ by servicemix.

aznmedia digz6666 at gmail.com
Sun Dec 14 14:06:57 GMT 2008




Holger Hoffstätte-2 wrote:
> 
> aznmedia wrote:
>> 
>> I'm writing my xbean.xml file like following:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns:jee="http://www.springframework.org/schema/jee"
>>       xmlns="http://www.springframework.org/schema/beans"
>>       xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>       xsi:schemaLocation="http://servicemix.apache.org/jms/1.0
>> http://servicemix.apache.org/schema/servicemix-jms-3.2.2.xsd
>>       http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>> 
>>        <jms:consumer service="my:ConsumerService"
>>                endpoint="mq"
>>                destinationName="rabbit-queue"
>>                connectionFactory="#connectionFactory"
>>                concurrentConsumers="8" />
>> 
>> 
>>        <bean id="connectionFactory"
>> class="com.rabbitmq.client.ConnectionFactory">
> [..]
> 
> I think there is some general confusion going on here. The ServiceMix
> consumer bean expects a *JMS* ConnectionFactory, but that will not work
> with the RabbitMQ connection factory, since it plays the same role
> (connection management) but does *not* implement the necessary JMS
> functionality. You will either have to wait until AMQP (or in this case
> the RabbitMQ library) implements JMS, or write your own AMQP/Rabbit
> transport for ServiceMix. Alternatively you might try a Qpid client
> library which is reported to work against a Rabbit broker (though I cannot
> say how well).
> 
> -h
> 
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> 
> 

JMS service unit deployed with exceptions. It shows following exception:
java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>
<jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message"
version="1.0
">
<jbi-task-result>
<frmwk-task-result>
<frmwk-task-result-details>
<task-result-details>
<task-id>start</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
</task-result-details>
</frmwk-task-result-details>
</frmwk-task-result>
<component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>
        <component-name>servicemix-xmpp</component-name>
        <component-task-result-details>
                <task-result-details>
                        <task-id>start</task-id>
                        <task-result>FAILED</task-result>
                        <message-type>ERROR</message-type>
                        <task-status-msg>
<msg-loc-info>
<loc-token/>
<loc-message>Unable to start service unit</loc-message>
</msg-loc-info>
</task-status-msg>
                        <exception-info>
                                <nesting-level>1</nesting-level>
                                <msg-loc-info>
                                        <loc-token/>
                                        <loc-message>XMPPError connecting to
eon
-developer:5222.</loc-message>
                                        <stack-trace><![CDATA[XMPPError
connecti
ng to eon-developer:5222.: (502)
  -- caused by: java.net.ConnectException: Connection refused: connect
        at
org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPC
onnection.java:281)
        at
org.jivesoftware.smack.XMPPConnection.<init>(XMPPConnection.java:171)

        at
org.apache.servicemix.xmpp.XMPPEndpoint.start(XMPPEndpoint.java:77)
        at
org.apache.servicemix.xmpp.GroupChatEndpoint.start(GroupChatEndpoint.
java:51)
        at
org.apache.servicemix.common.DefaultServiceUnit.start(DefaultServiceU
nit.java:78)
        at
org.apache.servicemix.common.BaseServiceUnitManager.start(BaseService
UnitManager.java:155)
        at
org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle.start(Servic
eUnitLifeCycle.java:103)
        at
org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(Se
rviceAssemblyLifeCycle.java:132)
        at
org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.restore(
ServiceAssemblyLifeCycle.java:330)
        at
org.apache.servicemix.jbi.framework.DeploymentService.start(Deploymen
tService.java:100)
        at
org.apache.servicemix.jbi.container.JBIContainer.start(JBIContainer.j
ava:670)
        at
org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertie
sSet(SpringJBIContainer.java:115)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:264)
        at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:221)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:261)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:185)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:164)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:429)
        at
org.springframework.context.support.AbstractApplicationContext.finish
BeanFactoryInitialization(AbstractApplicationContext.java:729)
        at
org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:381)
        at
org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>
(ClassPathXmlApplicationContext.java:161)
        at
org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>
(ClassPathXmlApplicationContext.java:51)
        at org.apache.servicemix.Main.main(Main.java:53)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:461)
Nested Exception:
java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:519)
        at java.net.Socket.connect(Socket.java:469)
        at java.net.Socket.<init>(Socket.java:366)
        at java.net.Socket.<init>(Socket.java:180)
        at
org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPC
onnection.java:268)
        at
org.jivesoftware.smack.XMPPConnection.<init>(XMPPConnection.java:171)

        at
org.apache.servicemix.xmpp.XMPPEndpoint.start(XMPPEndpoint.java:77)
        at
org.apache.servicemix.xmpp.GroupChatEndpoint.start(GroupChatEndpoint.
java:51)
        at
org.apache.servicemix.common.DefaultServiceUnit.start(DefaultServiceU
nit.java:78)
        at
org.apache.servicemix.common.BaseServiceUnitManager.start(BaseService
UnitManager.java:155)
        at
org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle.start(Servic
eUnitLifeCycle.java:103)
        at
org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(Se
rviceAssemblyLifeCycle.java:132)
        at
org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.restore(
ServiceAssemblyLifeCycle.java:330)
        at
org.apache.servicemix.jbi.framework.DeploymentService.start(Deploymen
tService.java:100)
        at
org.apache.servicemix.jbi.container.JBIContainer.start(JBIContainer.j
ava:670)
        at
org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertie
sSet(SpringJBIContainer.java:115)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:264)
        at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:221)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:261)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:185)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:164)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:429)
        at
org.springframework.context.support.AbstractApplicationContext.finish
BeanFactoryInitialization(AbstractApplicationContext.java:729)
        at
org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:381)
        at
org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>
(ClassPathXmlApplicationContext.java:161)
        at
org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>
(ClassPathXmlApplicationContext.java:51)
        at org.apache.servicemix.Main.main(Main.java:53)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:461)
]]></stack-trace>
                                </msg-loc-info>
                        </exception-info>
                </task-result-details>
        </component-task-result-details>
</component-task-result>
</jbi-task-result>
</jbi-task>

        at
org.apache.servicemix.jbi.framework.ManagementSupport.failure(Managem
entSupport.java:125)
        at
org.apache.servicemix.jbi.framework.ManagementSupport.failure(Managem
entSupport.java:111)
        at
org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(Se
rviceAssemblyLifeCycle.java:146)
        at
org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.restore(
ServiceAssemblyLifeCycle.java:330)
        at
org.apache.servicemix.jbi.framework.DeploymentService.start(Deploymen
tService.java:100)
        at
org.apache.servicemix.jbi.container.JBIContainer.start(JBIContainer.j
ava:670)
        at
org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertie
sSet(SpringJBIContainer.java:115)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:264)
        at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:221)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:261)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:185)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:164)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:429)
        at
org.springframework.context.support.AbstractApplicationContext.finish
BeanFactoryInitialization(AbstractApplicationContext.java:729)
        at
org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:381)
        at
org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>
(ClassPathXmlApplicationContext.java:161)
        at
org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>
(ClassPathXmlApplicationContext.java:51)
        at org.apache.servicemix.Main.main(Main.java:53)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:461)

How can I write AMQP/Rabbittransport for ServiceMix? Is there any
documentation, specification, guides or examples?
-- 
View this message in context: http://www.nabble.com/Polling-message-from-RabbitMQ-by-servicemix.-tp20849425p21000664.html
Sent from the RabbitMQ mailing list archive at Nabble.com.





More information about the rabbitmq-discuss mailing list