You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Caa_man <ca...@acs-it.ru> on 2012/07/27 14:16:36 UTC

Several WMQ Managers

Hello everyone!

I would like to use several MQ managers in my Camel application (I use Camel
2.9.2) like this:

<route>
<from uri="wmq1:queue:WMQ1.QUEUE"/>
...
</route>

<route>
<from uri="wmq2:queue:WMQ2.QUEUE"/>
...
</route>

     <bean id="wmq1" class="org.apache.camel.component.jms.JmsComponent">
	  <property name="connectionFactory">
	    <bean class="com.ibm.mq.jms.MQConnectionFactory">
			<property name="transportType" value="1"/>
		    <property name="hostName" value="localhost"/>
		    <property name="port" value="1423"/>
		    <property name="queueManager" value="QM.FIRST"/>
	    </bean>
	  </property>
	</bean>

     <bean id="wmq2" class="org.apache.camel.component.jms.JmsComponent">
	  <property name="connectionFactory">
	    <bean class="com.ibm.mq.jms.MQConnectionFactory">
			<property name="transportType" value="1"/>
		    <property name="hostName" value="localhost"/>
		    <property name="port" value="1423"/>
		    <property name="queueManager" value="QM.SECOND"/>
	    </bean>
	  </property>
	</bean>

But it doesnt work and i have to use one JmsComponent with name "wmq". So i
hope use this JmsComponent in from's uri with specified QueueManager's name
(not only Queue's name) for several queuemanager/queue pairs. Is it
possible? Or... Are there other ways exist?



--
View this message in context: http://camel.465427.n5.nabble.com/Several-WMQ-Managers-tp5716548.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Several WMQ Managers

Posted by Caa_man <ca...@acs-it.ru>.
sorry, but I was mistaken...

My old config was:

        <route>
            <from <b>ref*="wmq1:queue:IN"/>
             ...................................
        </route>

but it should be written "uri".



--
View this message in context: http://camel.465427.n5.nabble.com/Several-WMQ-Managers-tp5716548p5716598.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Several WMQ Managers

Posted by Caa_man <ca...@acs-it.ru>.
Thank you for reply. It is strange, but suddenly it worked.

Error appeared in deployment stage (Oracle Application Server):

Operation failed with error: org.apache.camel.FailedToCreateRouteException:
Failed to create route route11: Route[[From[ref:wmq1:queue:IN]] ->
[process[ref:inUniversalP... because of No endpoint could be found for:
ref:wmq1:queue:IN, please check your camel registry with id wmq1:queue:IN 

2012-07-30 10:54:08,234 INFO [org.apache.camel.spring.SpringCamelContext] -
<Apache Camel 2.9.2 (CamelContext: camel-7) is starting>
2012-07-30 10:54:08,234 INFO [org.apache.camel.spring.SpringCamelContext] -
<Tracing is enabled on CamelContext: camel-7>
2012-07-30 10:54:08,234 INFO
[org.apache.camel.management.ManagementStrategyFactory] - <JMX enabled.
Using ManagedManagementStrategy.>
2012-07-30 10:54:08,234 INFO
[org.apache.camel.management.DefaultManagementLifecycleStrategy] -
<StatisticsLevel at All so enabling load performance statistics>
2012-07-30 10:54:08,250 INFO
[org.apache.camel.impl.converter.AnnotationTypeConverterLoader] - <Found 3
packages with 15 @Converter classes to load>
2012-07-30 10:54:08,250 INFO
[org.apache.camel.impl.converter.DefaultTypeConverter] - <Loaded 170 core
type converters (total 170 type converters)>
2012-07-30 10:54:08,265 INFO
[org.apache.camel.impl.converter.AnnotationTypeConverterLoader] - <Loaded 1
@Converter classes>
2012-07-30 10:54:08,265 INFO
[org.apache.camel.impl.converter.DefaultTypeConverter] - <Loaded additional
4 type converters (total 174 type converters) in 0.015 seconds>
2012-07-30 10:54:08,343 INFO [org.apache.camel.spring.SpringCamelContext] -
<Apache Camel 2.9.2 (CamelContext: camel-7) is shutting down>
2012-07-30 10:54:08,343 INFO [org.apache.camel.impl.DefaultShutdownStrategy]
- <Starting to graceful shutdown 0 routes (timeout 300 seconds)>
2012-07-30 10:54:08,343 INFO [org.apache.camel.impl.DefaultShutdownStrategy]
- <Graceful shutdown of 0 routes completed in 0 seconds>
2012-07-30 10:54:08,343 INFO
[org.apache.camel.impl.DefaultInflightRepository] - <Shutting down with no
inflight exchanges.>
2012-07-30 10:54:08,343 INFO [org.apache.camel.spring.SpringCamelContext] -
<Uptime: 0.109 seconds>
2012-07-30 10:54:08,343 INFO [org.apache.camel.spring.SpringCamelContext] -
<Apache Camel 2.9.2 (CamelContext: camel-7) is shutdown in 0.000 seconds>
2012-07-30 10:54:08,343 ERROR
[org.springframework.web.context.ContextLoader] - <Context initialization
failed>
org.apache.camel.RuntimeCamelException:
org.apache.camel.FailedToCreateRouteException: Failed to create route
route11: Route[[From[ref:wmq1:queue:IN]] -> [process[ref:inUniversalP...
because of No endpoint could be found for: ref:wmq1:queue:IN, please check
your camel registry with id wmq1:queue:IN
                at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1221)[camel-core-2.9.2.jar:2.9.2]
                at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)[camel-spring-2.9.2.jar:2.9.2]
                at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:240)[camel-spring-2.9.2.jar:2.9.2]
                at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
                at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
                at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
                at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
                at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)[org.springframework.web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
                at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)[org.springframework.web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
                at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)[org.springframework.web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
                at
com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1140)[oc4j-internal.jar:]
                at
com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:741)[oc4j-internal.jar:]
                at
com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:431)[oc4j-internal.jar:]
                at
com.evermind.server.Application.getHttpApplication(Application.java:586)[oc4j-internal.jar:]
                at
com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:1987)[oc4j-internal.jar:]
                at
com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(HttpSite.java:1906)[oc4j-internal.jar:]
                at
com.evermind.server.http.HttpSite.addHttpApplication(HttpSite.java:1603)[oc4j-internal.jar:]
                at
oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:302)[oc4j-internal.jar:]
                at
oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:121)[oc4j-internal.jar:]
                at
oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:99)[oc4j-internal.jar:]
                at
oracle.oc4j.admin.internal.ApplicationDeployer.bindWebApp(ApplicationDeployer.java:550)[oc4j-internal.jar:]
                at
oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:205)[oc4j-internal.jar:]
                at
oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)[oc4j-internal.jar:]
                at
oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)[oc4j-internal.jar:]
                at
oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)[oc4j-internal.jar:]
                at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)[oc4j-internal.jar:]
                at java.lang.Thread.run(Thread.java:619)[:1.6.0_16]
12/07/30 10:54:08 oracle.oc4j.admin.internal.DeployerException:
org.apache.camel.FailedToCreateRouteException: Failed to create route
route11: Route[[From[ref:wmq1:queue:IN]] -> [process[ref:inUniversalP...
because of No endpoint could be found for: ref:wmq1:queue:IN, please check
your camel registry with id wmq1:queue:IN
12/07/30 10:54:08           at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1221)
12/07/30 10:54:08           at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
12/07/30 10:54:08           at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:240)
12/07/30 10:54:08           at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
12/07/30 10:54:08           at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
12/07/30 10:54:08           at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
12/07/30 10:54:08           at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)
12/07/30 10:54:08           at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
12/07/30 10:54:08           at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
12/07/30 10:54:08           at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
12/07/30 10:54:08           at
com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1140)
12/07/30 10:54:08           at
com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:741)
12/07/30 10:54:08           at
com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:431)
12/07/30 10:54:08           at
com.evermind.server.Application.getHttpApplication(Application.java:586)
12/07/30 10:54:08           at
com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:1987)
12/07/30 10:54:08           at
com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(HttpSite.java:1906)
12/07/30 10:54:08           at
com.evermind.server.http.HttpSite.addHttpApplication(HttpSite.java:1603)
12/07/30 10:54:08           at
oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:302)
12/07/30 10:54:08           at
oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:121)
12/07/30 10:54:08           at
oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:99)
12/07/30 10:54:08           at
oracle.oc4j.admin.internal.ApplicationDeployer.bindWebApp(ApplicationDeployer.java:550)
12/07/30 10:54:08           at
oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:205)
12/07/30 10:54:08           at
oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
12/07/30 10:54:08           at
oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
12/07/30 10:54:08           at
oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
12/07/30 10:54:08           at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
12/07/30 10:54:08           at java.lang.Thread.run(Thread.java:619)
12/07/30 10:54:08 WARNING: DeployerRunnable.run
org.apache.camel.FailedToCreateRouteException: Failed to create route
route11: Route[[From[ref:wmq1:queue:IN]] -> [process[ref:inUniversalP...
because of No endpoint could be found for: ref:wmq1:queue:IN, please check
your camel registry with id
wmq1:queue:INoracle.oc4j.admin.internal.DeployerException:
org.apache.camel.FailedToCreateRouteException: Failed to create route
route11: Route[[From[ref:wmq1:queue:IN]] -> [process[ref:inUniversalP...
because of No endpoint could be found for: ref:wmq1:queue:IN, please check
your camel registry with id wmq1:queue:IN
                at
oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:126)
                at
oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
                at
oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
                at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
                at java.lang.Thread.run(Thread.java:619)


And configuration is:

    <camelContext trace="true"
xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="wmq1:queue:IN"/>
            <process ref="inUniversalPipeline"/>
            <process ref="authPipeline"/>
            <process ref="outDeclPipeline"/>
            <setHeader headerName="mySlip">
                <method beanType="gateway.camel.routes.router.ComputeSlip"/>
            </setHeader>
            <routingSlip>
                <header>mySlip</header>
            </routingSlip>
        </route>
    </camelContext>
    <bean id="wmq1" class="org.apache.camel.component.jms.JmsComponent">
        <property name="connectionFactory">
            <bean class="com.ibm.mq.jms.MQConnectionFactory">
                <property name="transportType" value="1"/>
                <property name="hostName" value="localhost"/>
                <property name="port" value="1423"/>
                <property name="queueManager" value="QM_TEST"/>
            </bean>
        </property>
    </bean>

But when I simply rewrote camel config file , the application deployed
without any error.



--
View this message in context: http://camel.465427.n5.nabble.com/Several-WMQ-Managers-tp5716548p5716596.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Several WMQ Managers

Posted by Babak Vahdat <ba...@swissonline.ch>.
Hi

I've added a unit-test based on your issue, however based on ActiveMQ which
we use for JMS testing.

http://svn.apache.org/viewvc?view=revision&revision=1366483

So I wonder what's exactly the issue you're facing. Maybe provide more
information like stacktrace, logs, etc..

Babak



--
View this message in context: http://camel.465427.n5.nabble.com/Several-WMQ-Managers-tp5716548p5716564.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Several WMQ Managers

Posted by Babak Vahdat <ba...@swissonline.ch>.

Am 27.07.12 14:16 schrieb "Caa_man" unter <ca...@acs-it.ru>:

>Hello everyone!
>
>I would like to use several MQ managers in my Camel application (I use
>Camel
>2.9.2) like this:
>
><route>
><from uri="wmq1:queue:WMQ1.QUEUE"/>
>...
></route>
>
><route>
><from uri="wmq2:queue:WMQ2.QUEUE"/>
>...
></route>
>
>     <bean id="wmq1" class="org.apache.camel.component.jms.JmsComponent">
>	  <property name="connectionFactory">
>	    <bean class="com.ibm.mq.jms.MQConnectionFactory">
>			<property name="transportType" value="1"/>
>		    <property name="hostName" value="localhost"/>
>		    <property name="port" value="1423"/>
>		    <property name="queueManager" value="QM.FIRST"/>
>	    </bean>
>	  </property>
>	</bean>
>
>     <bean id="wmq2" class="org.apache.camel.component.jms.JmsComponent">
>	  <property name="connectionFactory">
>	    <bean class="com.ibm.mq.jms.MQConnectionFactory">
>			<property name="transportType" value="1"/>
>		    <property name="hostName" value="localhost"/>
>		    <property name="port" value="1423"/>
>		    <property name="queueManager" value="QM.SECOND"/>
>	    </bean>
>	  </property>
>	</bean>
>
>But it doesnt work and i have to use one JmsComponent with name "wmq". So
>i
>hope use this JmsComponent in from's uri with specified QueueManager's
>name
>(not only Queue's name) for several queuemanager/queue pairs. Is it
>possible? Or... Are there other ways exist?
>

No you can't specify a QueueManager name inside the URI by the from
clause, as the concept of QueueManager is an IBM abstraction which is
*not* part of the JMS specification, so why not supported. For example
AFAIK ActiveMQ doesn't have the notion of QueueManager and whatnot.

To my understanding the way you've tried should already work (using
different bean id's). So what is exactly the problem? What do you mean
with "But it doesn't work"?

Babak 

>
>
>--
>View this message in context:
>http://camel.465427.n5.nabble.com/Several-WMQ-Managers-tp5716548.html
>Sent from the Camel - Users mailing list archive at Nabble.com.