Siddhi Error connecting to JMS provider

风格不统一 提交于 2020-06-29 04:48:09

问题


I tried to send events from WSO2 SP to activeMQ via siddhi-io-jms extension, but i have following error. Error connecting to JMS provider. NamingException while obtaining initial context. I have followed this doc for support jms transporting https://docs.wso2.com/display/SP400/Supporting+Different+Transports, put all necessary jar files to lib, also I set correctly @sink in siddhi app, factory.initial and provider.url are correct. Any idea, why SP can't connect to jms?


回答1:


According to OSGi JNDI spec, all the InitialContextFactories should be exposed as OSGi services. But activemq-client-5.x.x.jar file doesn't contain SPI, but rather they set system properties. This causes the NamingException while obtaining initial context. So we need to register those ICF to OSGi env.

For this we need to use the icf-provider.(sh|bat) tool within SP_HOME/bin. This will add a BundleActivator to the user provided jar/bundle which will register the user mentioned ICF implementation according to the OSGi JNDI spec.

e.g.

./icf-provider.sh org.apache.activemq.jndi.ActiveMQInitialContextFactory <Jar Directory/activemq-client-5.9.0.jar> <Destination>

Refer https://github.com/wso2-extensions/siddhi-io-jms/



来源:https://stackoverflow.com/questions/49506291/siddhi-error-connecting-to-jms-provider

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!