IBM MQ Integration JMS Gateway Binding
ravi21588 Mar 6, 2016 9:05 AMHi,
Iam trying to connect to IBM MQ from switchyard application.
Iam using
MQ Version: 7.5.0.1
Jboss FSW 6.0.0 GA
Jboss EAP 6.1
i have added the resource adapters in standalone-full.xml and started the server in standalone-full mode.
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">
<resource-adapters>
<resource-adapter id="wmq.jmsra.rar">
<archive>
wmq.jmsra.rar
</archive>
<transaction-support>NoTransaction</transaction-support>
<connection-definitions>
<connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl" jndi-name="java:jboss/MQConnectionFactory" pool-name="MQConnectionFactory">
<config-property name="port">
1415
</config-property>
<config-property name="channel">
SYSTEM.DEF.SVRCONN
</config-property>
<config-property name="hostName">
127.0.0.1
</config-property>
<config-property name="transportType">
CLIENT
</config-property>
<config-property name="queueManager">
IBMMQQM
</config-property>
</connection-definition>
</connection-definitions>
<admin-objects>
<admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/TESTQUEUE" pool-name="TESTQUEUE">
<config-property name="baseQueueName">
TESTQUEUE
</config-property>
</admin-object>
</admin-objects>
</resource-adapter>
</resource-adapters>
</subsystem>
Took the jcs adapter from C:\Program Files (x86)\IBM\WebSphere MQ\java\lib\jca and
Deployed wmq.jmsra.rar in to the application container.
Refered below link for configuration.
I had taken the camel-jms binding from quickstart and iam trying it to integrate it with IBM MQ.
The only change i had done is in switchyard xml.
<?xml version="1.0" encoding="UTF-8"?>
<switchyard xmlns="urn:switchyard-config:switchyard:1.0" xmlns:bean="urn:switchyard-component-bean:config:1.0" xmlns:jms="urn:switchyard-component-camel-jms:config:1.0" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912">
<sca:composite name="camel-jms-binding" targetNamespace="urn:switchyard-quickstart:camel-jms-binding:0.1.0">
<sca:service name="GreetingService" promote="GreetingService/GreetingService">
<jms:binding.jms>
<jms:queue>TESTQUEUE</jms:queue>
<jms:connectionFactory>#MQConnectionFactory</jms:connectionFactory>
</jms:binding.jms>
</sca:service>
<sca:component name="GreetingService">
<bean:implementation.bean class="org.switchyard.quickstarts.camel.jms.binding.GreetingServiceBean"/>
<sca:service name="GreetingService">
<sca:interface.java interface="org.switchyard.quickstarts.camel.jms.binding.GreetingService"/>
</sca:service>
</sca:component>
</sca:composite>
</switchyard>
iam getting below exception when deploying the code in eap.
17:14:36,486 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "switchyard-quickstart-camel-jms-binding.jar" (runtime-name: "switchyard-quickstart-camel-jms-binding.jar")
17:14:36,674 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment switchyard-quickstart-camel-jms-binding.jar
17:14:36,877 INFO [org.jboss.weld.deployer] (MSC service thread 1-6) JBAS016005: Starting Services for CDI deployment: switchyard-quickstart-camel-jms-binding.jar
17:14:36,877 INFO [org.switchyard] (MSC service thread 1-6) Deploying SwitchYard application 'switchyard-quickstart-camel-jms-binding.jar'
17:14:36,893 INFO [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016008: Starting weld service for deployment switchyard-quickstart-camel-jms-binding.jar
17:14:36,986 INFO [org.switchyard] (MSC service thread 1-3) Starting SwitchYard service
17:14:37,033 INFO [org.apache.camel.management.ManagementStrategyFactory] (MSC service thread 1-3) JMX enabled.
17:14:37,049 INFO [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-3) Apache Camel 1.1.1-p5-redhat-1 (CamelContext: camel-4) is starting
17:14:37,111 INFO [org.apache.camel.impl.converter.DefaultTypeConverter] (MSC service thread 1-3) Loaded 181 type converters
17:14:37,143 INFO [org.apache.camel.management.DefaultManagementLifecycleStrategy] (MSC service thread 1-3) StatisticsLevel at All so enabling load performance statistics
17:14:37,158 INFO [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-3) Total 0 routes, of which 0 is started.
17:14:37,158 INFO [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-3) Apache Camel 1.1.1-p5-redhat-1 (CamelContext: camel-4) started in 0.109 seconds
17:14:37,674 INFO [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-3) Route: direct:{urn:switchyard-quickstart:camel-jms-binding:0.1.0}GreetingService started and consuming from: Endpoint[direct://%7Burn:switchyard-quickstart:camel-jms-binding:0.1.0%7DGreetingService]
17:14:37,752 INFO [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-3) Apache Camel 1.1.1-p5-redhat-1 (CamelContext: camel-4) is shutting down
17:14:37,752 INFO [org.apache.camel.impl.DefaultShutdownStrategy] (MSC service thread 1-3) Starting to graceful shutdown 1 routes (timeout 30 seconds)
17:14:37,752 INFO [org.apache.camel.impl.DefaultShutdownStrategy] (Camel (camel-4) thread #7 - ShutdownTask) Route: direct:{urn:switchyard-quickstart:camel-jms-binding:0.1.0}GreetingService shutdown complete, was consuming from: Endpoint[direct://%7Burn:switchyard-quickstart:camel-jms-binding:0.1.0%7DGreetingService]
17:14:37,752 INFO [org.apache.camel.impl.DefaultShutdownStrategy] (MSC service thread 1-3) Graceful shutdown of 1 routes completed in 0 seconds
17:14:37,768 INFO [org.apache.camel.impl.converter.DefaultTypeConverter] (MSC service thread 1-3) TypeConverterRegistry utilization[attempts=1, hits=1, misses=0, failures=0] mappings[total=181, misses=0]
17:14:37,783 INFO [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-3) Apache Camel 1.1.1-p5-redhat-1 (CamelContext: camel-4) is shutdown in 0.031 seconds. Uptime 0.734 seconds.
17:14:37,783 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."switchyard-quickstart-camel-jms-binding.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."switchyard-quickstart-camel-jms-binding.jar".SwitchYardService: org.switchyard.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route V1CamelJmsBindingModel/GreetingService@_GreetingService_jms_1#1580939468: Route[[From[jms:queue:TESTQUEUE?connectionFactory=%23MQConne... because of Failed to resolve endpoint: jms://queue:TESTQUEUE?connectionFactory=%23MQConnectionFactory due to: No bean could be found in the registry for: MQConnectionFactory of type: javax.jms.ConnectionFactory
at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:80)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]
Caused by: org.switchyard.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route V1CamelJmsBindingModel/GreetingService@_GreetingService_jms_1#1580939468: Route[[From[jms:queue:TESTQUEUE?connectionFactory=%23MQConne... because of Failed to resolve endpoint: jms://queue:TESTQUEUE?connectionFactory=%23MQConnectionFactory due to: No bean could be found in the registry for: MQConnectionFactory of type: javax.jms.ConnectionFactory
at org.switchyard.component.camel.common.handler.InboundHandler.<init>(InboundHandler.java:69)
at org.switchyard.component.camel.common.deploy.BaseBindingActivator.createInboundHandler(BaseBindingActivator.java:51)
at org.switchyard.component.camel.common.deploy.BaseBindingActivator.activateBinding(BaseBindingActivator.java:43)
at org.switchyard.deploy.internal.Deployment.deployServiceBindings(Deployment.java:618)
at org.switchyard.deploy.internal.Deployment.start(Deployment.java:145)
at org.switchyard.as7.extension.deployment.SwitchYardDeployment.start(SwitchYardDeployment.java:101)
at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:73)
... 5 more
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route V1CamelJmsBindingModel/GreetingService@_GreetingService_jms_1#1580939468: Route[[From[jms:queue:TESTQUEUE?connectionFactory=%23MQConne... because of Failed to resolve endpoint: jms://queue:TESTQUEUE?connectionFactory=%23MQConnectionFactory due to: No bean could be found in the registry for: MQConnectionFactory of type: javax.jms.ConnectionFactory
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:177)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:731)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1803)
at org.apache.camel.impl.DefaultCamelContext.addRouteDefinitions(DefaultCamelContext.java:675)
at org.apache.camel.impl.DefaultCamelContext.addRouteDefinition(DefaultCamelContext.java:680)
at org.switchyard.component.camel.common.handler.InboundHandler.<init>(InboundHandler.java:67)
... 11 more
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: jms://queue:TESTQUEUE?connectionFactory=%23MQConnectionFactory due to: No bean could be found in the registry for: MQConnectionFactory of type: javax.jms.ConnectionFactory
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:488)
at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:61)
at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:187)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:108)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:114)
at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)
at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:90)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:857)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:172)
... 16 more
Caused by: org.apache.camel.NoSuchBeanException: No bean could be found in the registry for: MQConnectionFactory of type: javax.jms.ConnectionFactory
at org.apache.camel.util.CamelContextHelper.mandatoryLookup(CamelContextHelper.java:141)
at org.apache.camel.util.EndpointHelper.resolveReferenceParameter(EndpointHelper.java:320)
at org.apache.camel.util.EndpointHelper.resolveReferenceParameter(EndpointHelper.java:302)
at org.apache.camel.impl.DefaultComponent.resolveAndRemoveReferenceParameter(DefaultComponent.java:304)
at org.apache.camel.impl.DefaultComponent.resolveAndRemoveReferenceParameter(DefaultComponent.java:283)
at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:491)
at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91)
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:469)
... 24 more
17:14:38,002 ERROR [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "switchyard-quickstart-camel-jms-binding.jar" was rolled back with the following failure message:
{"JBAS014671: Failed services" => {"jboss.deployment.unit.\"switchyard-quickstart-camel-jms-binding.jar\".SwitchYardService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"switchyard-quickstart-camel-jms-binding.jar\".SwitchYardService: org.switchyard.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route V1CamelJmsBindingModel/GreetingService@_GreetingService_jms_1#1580939468: Route[[From[jms:queue:TESTQUEUE?connectionFactory=%23MQConne... because of Failed to resolve endpoint: jms://queue:TESTQUEUE?connectionFactory=%23MQConnectionFactory due to: No bean could be found in the registry for: MQConnectionFactory of type: javax.jms.ConnectionFactory
Caused by: org.switchyard.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route V1CamelJmsBindingModel/GreetingService@_GreetingService_jms_1#1580939468: Route[[From[jms:queue:TESTQUEUE?connectionFactory=%23MQConne... because of Failed to resolve endpoint: jms://queue:TESTQUEUE?connectionFactory=%23MQConnectionFactory due to: No bean could be found in the registry for: MQConnectionFactory of type: javax.jms.ConnectionFactory
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route V1CamelJmsBindingModel/GreetingService@_GreetingService_jms_1#1580939468: Route[[From[jms:queue:TESTQUEUE?connectionFactory=%23MQConne... because of Failed to resolve endpoint: jms://queue:TESTQUEUE?connectionFactory=%23MQConnectionFactory due to: No bean could be found in the registry for: MQConnectionFactory of type: javax.jms.ConnectionFactory
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: jms://queue:TESTQUEUE?connectionFactory=%23MQConnectionFactory due to: No bean could be found in the registry for: MQConnectionFactory of type: javax.jms.ConnectionFactory
Caused by: org.apache.camel.NoSuchBeanException: No bean could be found in the registry for: MQConnectionFactory of type: javax.jms.ConnectionFactory"}}
17:14:38,002 INFO [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016009: Stopping weld service for deployment switchyard-quickstart-camel-jms-binding.jar
17:14:38,064 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment switchyard-quickstart-camel-jms-binding.jar (runtime-name: switchyard-quickstart-camel-jms-binding.jar) in 62ms
Can you please tell me have i missed anything in configuration?