Camel HL7 component
jdestef Jul 12, 2012 10:02 AMHi,
Trying to set up the camel hl7 component. I added additional modules to the server module directory for camel mina and camel hl7. The module.xml files look like this:
jboss_server_root/modules/org/apache/camel/hl7/main:
{code:xml}
<module xmlns="urn:jboss:module:1.0" name="org.apache.camel.hl7">
<resources>
<resource-root path="camel-hl7-2.9.2.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="org.apache.camel.core"/>
<module name="org.apache.camel.spring"/>
<module name="org.apache.commons.logging"/>
<module name="org.springframework"/>
<module name="org.slf4j"/>
</dependencies>
</module>
{code}
jboss_server_root/modules/org/apache/camel/mina/main:
{code:xml}
<module xmlns="urn:jboss:module:1.0" name="org.apache.camel.mina">
<resources>
<resource-root path="camel-mina-2.9.2.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="org.apache.camel.core"/>
<module name="org.apache.camel.spring"/>
<module name="org.apache.commons.logging"/>
<module name="org.springframework"/>
<module name="org.slf4j"/>
</dependencies>
</module>
{code}
I added dependencies to the project manifest.mf as follows:
Dependencies: org.apache.mina, org.apache.camel.mina, org.apache.camel.hl7
The documentation on the Camel site for the hl7 component has a uri that looks like this:
mina:tcp://localhost:8888?sync=true&codec=#hl7codec
For the last parameter, codec, I tried just creating a named bean (in the source attached). Camel uses spring to configure this parameter. Not quite sure what would be analogous in Switchyard.
The switchyard.xml is as follows:
{code: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:camel="urn:switchyard-component-camel:config:1.0" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="test_hl7" targetNamespace="urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT">
<sca:composite name="test_hl7" targetNamespace="urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT">
<sca:service name="MessageReaderService" promote="MessageReaderServiceBean/MessageReaderService">
<sca:interface.java interface="com.example.switchyard.test_hl7.MessageReaderService"/>
<camel:binding.camel configURI="mina:tcp://localhost:8888?sync=true&codec=#hl7Codec"/>
</sca:service>
<sca:component name="MessageReaderServiceBean">
<bean:implementation.bean class="com.example.switchyard.test_hl7.MessageReaderServiceBean"/>
<sca:service name="MessageReaderService">
<sca:interface.java interface="com.example.switchyard.test_hl7.MessageReaderService"/>
</sca:service>
</sca:component>
</sca:composite>
</switchyard>
{code}
When I deploy I get the following exception:
09:30:43,304 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.deployment.unit."test_hl7.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."test_hl7.jar".SwitchYardService: org.switchyard.exception.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route {urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService-[mina:tcp://localhost:8888?sync=true&codec=#hl7Codec]: Route[[From[mina:tcp://localhost:8888?sync=true&codec=#hl7Co... because of Failed to resolve endpoint: mina://tcp://localhost:8888?codec=%23hl7Codec&sync=true due to: No component found with scheme: mina
at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:79)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_04]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_04]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_04]
Caused by: org.switchyard.exception.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route {urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService-[mina:tcp://localhost:8888?sync=true&codec=#hl7Codec]: Route[[From[mina:tcp://localhost:8888?sync=true&codec=#hl7Co... because of Failed to resolve endpoint: mina://tcp://localhost:8888?codec=%23hl7Codec&sync=true due to: No component found with scheme: mina
at org.switchyard.component.camel.InboundHandler.<init>(InboundHandler.java:81)
at org.switchyard.component.camel.deploy.CamelActivator.activateBinding(CamelActivator.java:123)
at org.switchyard.deploy.internal.Deployment.deployServiceBindings(Deployment.java:428)
at org.switchyard.deploy.internal.Deployment.start(Deployment.java:141)
at org.switchyard.as7.extension.deployment.SwitchYardDeployment.start(SwitchYardDeployment.java:103)
at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:72)
... 5 more
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route {urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService-[mina:tcp://localhost:8888?sync=true&codec=#hl7Codec]: Route[[From[mina:tcp://localhost:8888?sync=true&codec=#hl7Co... because of Failed to resolve endpoint: mina://tcp://localhost:8888?codec=%23hl7Codec&sync=true due to: No component found with scheme: mina
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:173)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:709)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1733)
at org.apache.camel.impl.DefaultCamelContext.addRouteDefinitions(DefaultCamelContext.java:653)
at org.apache.camel.impl.DefaultCamelContext.addRouteDefinition(DefaultCamelContext.java:658)
at org.switchyard.component.camel.InboundHandler.<init>(InboundHandler.java:79)
... 10 more
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: mina://tcp://localhost:8888?codec=%23hl7Codec&sync=true due to: No component found with scheme: mina
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:461)
at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:48)
at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:183)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)
at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)
at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:89)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:833)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:168)
... 15 more
09:30:43,315 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "test_hl7.jar" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"test_hl7.jar\".SwitchYardService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"test_hl7.jar\".SwitchYardService: org.switchyard.exception.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route {urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService-[mina:tcp://localhost:8888?sync=true&codec=#hl7Codec]: Route[[From[mina:tcp://localhost:8888?sync=true&codec=#hl7Co... because of Failed to resolve endpoint: mina://tcp://localhost:8888?codec=%23hl7Codec&sync=true due to: No component found with scheme: mina"}}
09:30:43,316 INFO [org.jboss.weld.deployer] (MSC service thread 1-14) JBAS016009: Stopping weld service for deployment test_hl7.jar
09:30:43,323 INFO [org.jboss.as.server.deployment] (MSC service thread 1-14) JBAS015877: Stopped deployment test_hl7.jar in 8ms
09:30:43,324 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."test_hl7.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."test_hl7.jar".SwitchYardService: org.switchyard.exception.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route {urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService-[mina:tcp://localhost:8888?sync=true&codec=#hl7Codec]: Route[[From[mina:tcp://localhost:8888?sync=true&codec=#hl7Co... because of Failed to resolve endpoint: mina://tcp://localhost:8888?codec=%23hl7Codec&sync=true due to: No component found with scheme: mina
09:30:43,326 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"test_hl7.jar\".SwitchYardService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"test_hl7.jar\".SwitchYardService: org.switchyard.exception.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route {urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService-[mina:tcp://localhost:8888?sync=true&codec=#hl7Codec]: Route[[From[mina:tcp://localhost:8888?sync=true&codec=#hl7Co... because of Failed to resolve endpoint: mina://tcp://localhost:8888?codec=%23hl7Codec&sync=true due to: No component found with scheme: mina"}}}}
I've attached the project.
Thanks in advance for any help you can provide.
-
test_hl7.zip 18.4 KB