You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by apendo <an...@direktberatung.de> on 2008/02/15 14:28:33 UTC
Howto connect a Camel-SU to an activemq-Topic
Hi there,
this is a rather simple question but i didn't manage to find an exemplary
configuration that would save my and hopefully someone elses time.
I'm trying to receive messages from a jms-topic through a camel-component,
configured in servicemix like this:
public void configure() {
from("activemq:topic:foo.bar").to("log:org.apache.servicemix.tutorial");
}
and i configured the camel-context too:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
<camelContext useJmx="false"
xmlns="http://activemq.apache.org/camel/schema/spring">
...
</camelContext>
<!-- lets configure the default ActiveMQ broker URL -->
<bean id="activemq" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616"/>
</bean>
</property>
</bean>
</beans>
I get the following error-msg when i try to deploy it (stack-trace only):
<![CDATA[org.apache.xbean.kernel.ServiceRegistrationException:
org.apache.camel.RuntimeCamelException:
org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
activemq:ActiveMQ.Advisory.Queue
at
org.apache.xbean.kernel.standard.ServiceManagerRegistry.registerService(ServiceManagerRegistry.java:424)
at
org.apache.xbean.kernel.standard.StandardKernel.registerService(StandardKernel.java:220)
at
org.apache.xbean.server.spring.loader.SpringLoader.load(SpringLoader.java:152)
at
org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:83)
at
org.apache.servicemix.camel.CamelSpringDeployer.deploy(CamelSpringDeployer.java:79)
at
org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)
at
org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)
at
org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:508)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:350)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:253)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:647)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:60)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:611)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: org.apache.camel.RuntimeCamelException:
org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
activemq:ActiveMQ.Advisory.Queue
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:98)
at
org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
at
org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)
at
org.apache.xbean.server.spring.configuration.SpringConfiguration.<init>(SpringConfiguration.java:63)
at
org.apache.xbean.server.spring.configuration.SpringConfigurationServiceFactory.createService(SpringConfigurationServiceFactory.java:106)
at
org.apache.xbean.kernel.standard.ServiceManager.start(ServiceManager.java:420)
at
org.apache.xbean.kernel.standard.ServiceManager.initialize(ServiceManager.java:200)
at
org.apache.xbean.kernel.standard.RegistryFutureTask$RegisterCallable.call(RegistryFutureTask.java:110)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
org.apache.xbean.kernel.standard.ServiceManagerRegistry.registerService(ServiceManagerRegistry.java:409)
... 14 more
So the question is how do i properly access (or address) the servicemix
jms-topic from a camel-su?
Cheers,
Toni
--
View this message in context: http://www.nabble.com/Howto-connect-a-Camel-SU-to-an-activemq-Topic-tp15501099s12049p15501099.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Howto connect a Camel-SU to an activemq-Topic
Posted by James Strachan <ja...@gmail.com>.
I'm slightly confused by this bit of the stack trace...
On 15/02/2008, apendo <an...@direktberatung.de> wrote:
>
> Hi there,
> this is a rather simple question but i didn't manage to find an exemplary
> configuration that would save my and hopefully someone elses time.
>
> I'm trying to receive messages from a jms-topic through a camel-component,
> configured in servicemix like this:
>
> public void configure() {
>
>
> from("activemq:topic:foo.bar").to("log:org.apache.servicemix.tutorial");
>
> }
>
>
>
> and i configured the camel-context too:
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> http://activemq.apache.org/camel/schema/spring
> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
>
> <camelContext useJmx="false"
> xmlns="http://activemq.apache.org/camel/schema/spring">
> ...
> </camelContext>
>
> <!-- lets configure the default ActiveMQ broker URL -->
> <bean id="activemq" class="org.apache.camel.component.jms.JmsComponent">
> <property name="connectionFactory">
> <bean class="org.apache.activemq.ActiveMQConnectionFactory">
> <property name="brokerURL" value="tcp://localhost:61616"/>
> </bean>
> </property>
> </bean>
>
> </beans>
>
>
>
> I get the following error-msg when i try to deploy it (stack-trace only):
>
> <![CDATA[org.apache.xbean.kernel.ServiceRegistrationException:
> org.apache.camel.RuntimeCamelException:
> org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
> activemq:ActiveMQ.Advisory.Queue
i.e. this is a different queue name to the one you were consuming from.
Also this...
> Caused by: org.apache.camel.RuntimeCamelException:
> org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
> activemq:ActiveMQ.Advisory.Queue
> at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:98)
Unfortunately thats not the actual cause - its a wrapped exception -
so we're not seeing the real stack trace.
FWIW I've just patched Camel trunk so that it doesn't wrap any
RuntimeException instances thrown during initialisation
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com
Re: Howto connect a Camel-SU to an activemq-Topic
Posted by James Strachan <ja...@gmail.com>.
On 15/02/2008, apendo <an...@direktberatung.de> wrote:
>
> OK, i need to withdraw my statement one reply ago.
>
> Lars was right: the only thing missing was the camel-jms library in
> camel-su's poms.xml!
> While experimenting with the source-code in the meanwhile i misspelt an uri
> and that lead to the same error again. Everything is working fine now.
>
> Thanx again to all for the quick reactions!
Awesome thanks for letting us know! :)
I just raised a JIRA actually to update our Camel sample to use ActiveMQ...
https://issues.apache.org/activemq/browse/SM-1229
as I can see lots of folks wanting to use Camel and ActiveMQ together
inside ServiceMix
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com
Re: Howto connect a Camel-SU to an activemq-Topic
Posted by apendo <an...@direktberatung.de>.
OK, i need to withdraw my statement one reply ago.
Lars was right: the only thing missing was the camel-jms library in
camel-su's poms.xml!
While experimenting with the source-code in the meanwhile i misspelt an uri
and that lead to the same error again. Everything is working fine now.
Thanx again to all for the quick reactions!
Cheers, Toni
James.Strachan wrote:
>
> Have you added ActiveMQ 5.0.0 as well as a dependency btw?
>
> On 15/02/2008, apendo <an...@direktberatung.de> wrote:
>>
>> Hi Lars, thnx for the quick reply.
>>
>>
>>
>> lhe wrote:
>> >
>> > Toni,
>> >
>> > have you got the
>> >
>> > <dependency>
>> > <groupId>org.apache.camel</groupId>
>> > <artifactId>camel-jms</artifactId>
>> > <version>${camel-version}</version>
>> > </dependency>
>> >
>> > in your SU's pom.xml dependencies section?
>> >
>>
>>
>> No, i missed to do that but adding this dependency to the camel-su
>> changed
>> nothing, i'm still getting the same error.
>>
>> Here is the SU's pom.xml:
>> <?xml version="1.0" encoding="UTF-8"?><project>
>> <parent>
>> <artifactId>parent</artifactId>
>> <groupId>org.apache.servicemix.tutorial</groupId>
>> <version>1.0-SNAPSHOT</version>
>> </parent>
>> <modelVersion>4.0.0</modelVersion>
>> <groupId>org.apache.servicemix.tutorial</groupId>
>> <artifactId>tutorial-camel-su</artifactId>
>> <packaging>jbi-service-unit</packaging>
>> <name>Tutorial :: Camel :: SU</name>
>> <version>1.0-SNAPSHOT</version>
>> <url>http://org.apache.tutorial</url>
>> <build>
>> <defaultGoal>install</defaultGoal>
>> <plugins>
>> <plugin>
>> <artifactId>maven-compiler-plugin</artifactId>
>> <configuration>
>> <source>1.5</source>
>> <target>1.5</target>
>> </configuration>
>> </plugin>
>> <plugin>
>> <groupId>org.apache.servicemix.tooling</groupId>
>> <artifactId>jbi-maven-plugin</artifactId>
>> <version>${servicemix-version}</version>
>> <extensions>true</extensions>
>> </plugin>
>> <plugin>
>>
>> <groupId>org.apache.camel</groupId>
>>
>> <artifactId>camel-maven-plugin</artifactId>
>> <version>${camel-version}</version>
>> </plugin>
>> </plugins>
>> </build>
>> ...
>> <dependencies>
>> <dependency>
>> <groupId>org.apache.servicemix</groupId>
>> <artifactId>servicemix-camel</artifactId>
>> <version>${servicemix-version}</version>
>> </dependency>
>>
>> <dependency>
>> <groupId>org.apache.camel</groupId>
>> <artifactId>camel-jms</artifactId>
>> <version>${camel-version}</version>
>> </dependency>
>>
>> <dependency>
>> <groupId>org.apache.servicemix</groupId>
>> <artifactId>servicemix-core</artifactId>
>> <version>${servicemix-version}</version>
>> <scope>provided</scope>
>> </dependency>
>> </dependencies>
>> <properties>
>> <servicemix-version>3.2.1</servicemix-version>
>> <camel-version>1.2.0</camel-version>
>> </properties>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Howto-connect-a-Camel-SU-to-an-activemq-Topic-tp15501099s12049p15502023.html
>>
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
>
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://open.iona.com
>
>
--
View this message in context: http://www.nabble.com/Howto-connect-a-Camel-SU-to-an-activemq-Topic-tp15501099s12049p15502947.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Howto connect a Camel-SU to an activemq-Topic
Posted by James Strachan <ja...@gmail.com>.
Have you added ActiveMQ 5.0.0 as well as a dependency btw?
On 15/02/2008, apendo <an...@direktberatung.de> wrote:
>
> Hi Lars, thnx for the quick reply.
>
>
>
> lhe wrote:
> >
> > Toni,
> >
> > have you got the
> >
> > <dependency>
> > <groupId>org.apache.camel</groupId>
> > <artifactId>camel-jms</artifactId>
> > <version>${camel-version}</version>
> > </dependency>
> >
> > in your SU's pom.xml dependencies section?
> >
>
>
> No, i missed to do that but adding this dependency to the camel-su changed
> nothing, i'm still getting the same error.
>
> Here is the SU's pom.xml:
> <?xml version="1.0" encoding="UTF-8"?><project>
> <parent>
> <artifactId>parent</artifactId>
> <groupId>org.apache.servicemix.tutorial</groupId>
> <version>1.0-SNAPSHOT</version>
> </parent>
> <modelVersion>4.0.0</modelVersion>
> <groupId>org.apache.servicemix.tutorial</groupId>
> <artifactId>tutorial-camel-su</artifactId>
> <packaging>jbi-service-unit</packaging>
> <name>Tutorial :: Camel :: SU</name>
> <version>1.0-SNAPSHOT</version>
> <url>http://org.apache.tutorial</url>
> <build>
> <defaultGoal>install</defaultGoal>
> <plugins>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>1.5</source>
> <target>1.5</target>
> </configuration>
> </plugin>
> <plugin>
> <groupId>org.apache.servicemix.tooling</groupId>
> <artifactId>jbi-maven-plugin</artifactId>
> <version>${servicemix-version}</version>
> <extensions>true</extensions>
> </plugin>
> <plugin>
>
> <groupId>org.apache.camel</groupId>
>
> <artifactId>camel-maven-plugin</artifactId>
> <version>${camel-version}</version>
> </plugin>
> </plugins>
> </build>
> ...
> <dependencies>
> <dependency>
> <groupId>org.apache.servicemix</groupId>
> <artifactId>servicemix-camel</artifactId>
> <version>${servicemix-version}</version>
> </dependency>
>
> <dependency>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-jms</artifactId>
> <version>${camel-version}</version>
> </dependency>
>
> <dependency>
> <groupId>org.apache.servicemix</groupId>
> <artifactId>servicemix-core</artifactId>
> <version>${servicemix-version}</version>
> <scope>provided</scope>
> </dependency>
> </dependencies>
> <properties>
> <servicemix-version>3.2.1</servicemix-version>
> <camel-version>1.2.0</camel-version>
> </properties>
>
> --
> View this message in context: http://www.nabble.com/Howto-connect-a-Camel-SU-to-an-activemq-Topic-tp15501099s12049p15502023.html
>
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com
Re: Howto connect a Camel-SU to an activemq-Topic
Posted by apendo <an...@direktberatung.de>.
Hi Lars, thnx for the quick reply.
lhe wrote:
>
> Toni,
>
> have you got the
>
> <dependency>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-jms</artifactId>
> <version>${camel-version}</version>
> </dependency>
>
> in your SU's pom.xml dependencies section?
>
No, i missed to do that but adding this dependency to the camel-su changed
nothing, i'm still getting the same error.
Here is the SU's pom.xml:
<?xml version="1.0" encoding="UTF-8"?><project>
<parent>
<artifactId>parent</artifactId>
<groupId>org.apache.servicemix.tutorial</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.servicemix.tutorial</groupId>
<artifactId>tutorial-camel-su</artifactId>
<packaging>jbi-service-unit</packaging>
<name>Tutorial :: Camel :: SU</name>
<version>1.0-SNAPSHOT</version>
<url>http://org.apache.tutorial</url>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>jbi-maven-plugin</artifactId>
<version>${servicemix-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>${camel-version}</version>
</plugin>
</plugins>
</build>
...
<dependencies>
<dependency>
<groupId>org.apache.servicemix</groupId>
<artifactId>servicemix-camel</artifactId>
<version>${servicemix-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
<version>${camel-version}</version>
</dependency>
<dependency>
<groupId>org.apache.servicemix</groupId>
<artifactId>servicemix-core</artifactId>
<version>${servicemix-version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<properties>
<servicemix-version>3.2.1</servicemix-version>
<camel-version>1.2.0</camel-version>
</properties>
--
View this message in context: http://www.nabble.com/Howto-connect-a-Camel-SU-to-an-activemq-Topic-tp15501099s12049p15502023.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Howto connect a Camel-SU to an activemq-Topic
Posted by Lars Heinemann <la...@compart.net>.
Toni,
have you got the
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
<version>${camel-version}</version>
</dependency>
in your SU's pom.xml dependencies section?
Regards,
Lars
apendo schrieb:
> Hi there,
> this is a rather simple question but i didn't manage to find an exemplary
> configuration that would save my and hopefully someone elses time.
>
> I'm trying to receive messages from a jms-topic through a camel-component,
> configured in servicemix like this:
>
> public void configure() {
>
>
> from("activemq:topic:foo.bar").to("log:org.apache.servicemix.tutorial");
>
> }
>
>
>
> and i configured the camel-context too:
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> http://activemq.apache.org/camel/schema/spring
> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
>
> <camelContext useJmx="false"
> xmlns="http://activemq.apache.org/camel/schema/spring">
> ...
> </camelContext>
>
> <!-- lets configure the default ActiveMQ broker URL -->
> <bean id="activemq" class="org.apache.camel.component.jms.JmsComponent">
> <property name="connectionFactory">
> <bean class="org.apache.activemq.ActiveMQConnectionFactory">
> <property name="brokerURL" value="tcp://localhost:61616"/>
> </bean>
> </property>
> </bean>
>
> </beans>
>
>
>
> I get the following error-msg when i try to deploy it (stack-trace only):
>
> <![CDATA[org.apache.xbean.kernel.ServiceRegistrationException:
> org.apache.camel.RuntimeCamelException:
> org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
> activemq:ActiveMQ.Advisory.Queue
> at
> org.apache.xbean.kernel.standard.ServiceManagerRegistry.registerService(ServiceManagerRegistry.java:424)
> at
> org.apache.xbean.kernel.standard.StandardKernel.registerService(StandardKernel.java:220)
> at
> org.apache.xbean.server.spring.loader.SpringLoader.load(SpringLoader.java:152)
> at
> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:83)
> at
> org.apache.servicemix.camel.CamelSpringDeployer.deploy(CamelSpringDeployer.java:79)
> at
> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)
> at
> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)
> at
> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:508)
> at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:350)
> at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:253)
> at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:647)
> at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:60)
> at
> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:611)
> at java.util.TimerThread.mainLoop(Timer.java:512)
> at java.util.TimerThread.run(Timer.java:462)
> Caused by: org.apache.camel.RuntimeCamelException:
> org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
> activemq:ActiveMQ.Advisory.Queue
> at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:98)
> at
> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
> at
> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
> at
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
> at
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)
> at
> org.apache.xbean.server.spring.configuration.SpringConfiguration.<init>(SpringConfiguration.java:63)
> at
> org.apache.xbean.server.spring.configuration.SpringConfigurationServiceFactory.createService(SpringConfigurationServiceFactory.java:106)
> at
> org.apache.xbean.kernel.standard.ServiceManager.start(ServiceManager.java:420)
> at
> org.apache.xbean.kernel.standard.ServiceManager.initialize(ServiceManager.java:200)
> at
> org.apache.xbean.kernel.standard.RegistryFutureTask$RegisterCallable.call(RegistryFutureTask.java:110)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
> at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> at
> org.apache.xbean.kernel.standard.ServiceManagerRegistry.registerService(ServiceManagerRegistry.java:409)
> ... 14 more
>
>
> So the question is how do i properly access (or address) the servicemix
> jms-topic from a camel-su?
>
> Cheers,
> Toni
>