Switch Yard SNMP Service Binding

Latest response

Trying to add Camel SNMP to as a service binding for a EAP 6.1 Fuse Works Switchyard Project. Since it is not one of the included switchyard bindings, I've created a \jboss-eap-6.1\modules\system\layers\soa\org\apache\camel\snmp module, but here is where I started getting lost:
1) Registering it as a known extension; there is not a domain section in standalone.xml for me to include for switchyard
2) How do I handle the switchyard.xml definition of the service? I've tried the following:

<sca:interface.java interface="mil.navy.e6b.wst.facade.block1.sysman.SysmanService"/>

mil.navy.e6b.wst.facade.block1.sysman.SysmanService

loggingLevel="INFO"
message=">>> ${body}"/>


Am I on the right track? Or way off?? Your advice is very appreciated!

John

Attachments

Responses

Getting this from pom :
SWITCHYARD011602: Model [org.switchyard.config.model.switchyard.v1.V1SwitchYardModel] is invalid: cvc-complex-type.2.4.a: Invalid content was found starting with element 'camelContext'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":binding, "http://docs.oasis-open.org/ns/opencsa/sca/200912":callback, "http://docs.oasis-open.org/ns/opencsa/sca/200912":requires, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySetAttachment, "http://docs.oasis-open.org/ns/opencsa/sca/200912":extensions}' is expected. (org.switchyard:switchyard-plugin:1.1.1-p5-redhat-1:configure:default:process-classes)

Have to assume that the extension registartion I tried is not complete or that the JBoss Developer Studio is not 'seeing' what I've attempted...

Ok... getting there... Found this: https://docs.jboss.org/author/display/SWITCHYARD/Camel+URI and errors are going away... now trying to figure :
org.xml.sax.SAXParseException; lineNumber: 64; columnNumber: 64; The prefix "selector" for element "selector:operationSelector" is not bound. (org.switchyard:switchyard-plugin:1.1.1-p5-redhat-1:configure:default:process-classes)

Probably too literal on the example

Oh well... removed the operationSelector and back to:
SWITCHYARD011602: Model [org.switchyard.config.model.switchyard.v1.V1SwitchYardModel] is invalid: cvc-complex-type.2.4.a: Invalid content was found starting with element 'camel:binding.uri'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":binding, "http://docs.oasis-open.org/ns/opencsa/sca/200912":callback, "http://docs.oasis-open.org/ns/opencsa/sca/200912":requires, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySetAttachment, "http://docs.oasis-open.org/ns/opencsa/sca/200912":extensions}' is expected. (org.switchyard:switchyard-plugin:1.1.1-p5-redhat-1:configure:default:process-classes)

Solution: the tag is
<camel_1:binding.uri name="camel1" configURI="snmp:127.0.0.1:162?protocol=udp&amp;type=TRAP"/>

Notice the _1!

I did this the hard way... being new, and not understanding some of the terminology, in this case Camel URI... all I had to do was create service, binding type of camel and then provide the snmp string I wanted... Now to test it ;-)

BTW... still not sure about the instructions for installing the extension...
https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse_Service_Works/6/html-single/Development_Guide_Volume_1_SwitchYard/#chap-Extensions

There is NOT a in the standalone.xml for:
JBoss Enterprise Application Platform - Version 6.1.1.GA
Red Hat JBoss Fuse Service Works - Version 6.0.0.GA-redhat-2

Looks like you've got this one under control by yourself, John! I'll see if we can check on those instructions in the Development Guide.

Issue [1] created to improve content at [2].

Thank you for raising this issue, John. Thank you for your support, David.

[1] https://issues.jboss.org/browse/FUSEDOC-330
[2] https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse_Service_Works/6/html-single/Development_Guide_Volume_1_SwitchYard/#Creating_an_Extension_Module

Thanks Ben!

Me again ;-)

So, trying to deploy and run my Camel URI with SNMP trap listener. And seeing two different results. BTW, I modified the trusty netty quickstart, added project files, server and build logs to this discussion. This is what I'm seeing:
When I perform mvn install and look at the tests I see SUCCESS!
18:15:06,799 INFO [org.apache.camel.component.snmp.SnmpTrapConsumer] Starting trap consumer on udp:localhost/162
18:15:06,799 INFO [org.apache.camel.component.snmp.SnmpTrapConsumer] Started trap consumer on udp:localhost/162 using udp protocol
18:15:06,799 INFO [org.switchyard.common.camel.SwitchYardCamelContext] Route: V1CamelUriBindingModel/SysmanService@_SysmanService_uri_1#759448680 started and consuming from: SnmpEndpoint[udp:localhost/162]

When I deploy to standalone deployables:
18:08:41,022 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."netty-jdm.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."netty-jdm.jar".SwitchYardService: org.switchyard.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route V1CamelUriBindingModel/SysmanService@_SysmanService_uri_1#759448680: Route[[From[snmp:localhost:162?protocol=udp&type=TRAP&snmpVe... because of Failed to resolve endpoint: snmp://localhost:162?protocol=udp&snmpVersion=0&type=TRAP due to: No component found with scheme: snmp

Followed directions on adding a module: $JBOSS_HOME/modules/org/apache/camel/snmp/main with camel-snmp-2.14.0.jar and module.xml file:

<module xmlns="urn:jboss:module:1.0" name="org.apache.camel.snmp>

<resources>
    <resource-root path="camel-snmp-2.14.0.jar"/>
</resources>

<dependencies>
    <module name="org.slf4j"/>
    <module name="javax.api"/>
    <module name="org.jboss.netty"/>
    <module name="org.apache.camel.core"/>
    <module name="org.apache.commons.pool"/>
</dependencies>

Even added a Dependency: org.apache.camel.snmp to Manifest...

Alas, testing shows the Route created, but deployed to server... no joy...

Any ideas??

If you look at https://access.redhat.com/solutions/653823, there is a ZIP provided - xquery-saxon-module-and-test.zip. If you look at the application within that, you will find a file - camel-soap-proxy/src/main/resources/META-INF/jboss-deployment-structure.xml. Perhaps you need one of these files? Please let me know if this helps.

WHOO HOO!!! PARTEE!!! Sincere thanks!! That was the final piece of the puzzle!

09:51:19,333 INFO [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-7) Route: direct:{urn:switchyard-quickstart:camel-netty-binding:0.1.0}SysmanService started and consuming from: Endpoint[direct://%7Burn:switchyard-quickstart:camel-netty-binding:0.1.0%7DSysmanService]
09:51:19,363 INFO [org.apache.camel.component.snmp.SnmpTrapConsumer] (MSC service thread 1-7) Starting trap consumer on udp:localhost/162
09:51:19,364 INFO [org.apache.camel.component.snmp.SnmpTrapConsumer] (MSC service thread 1-7) Started trap consumer on udp:localhost/162 using udp protocol
09:51:19,365 INFO [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-7) Route: V1CamelUriBindingModel/SysmanService@_SysmanService_uri_1#759448680 started and consuming from: SnmpEndpoint[udp:localhost/162]

No worries. Glad to assist, John!

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.