WSO2 ESB / EI as JMS Topic consumer - Write to File - wso2

first of all: I'm quite new to the WSO2 products but I have taken the time to read through some post regarding to my issue.
What product I use: WSO EI 6.1.1
What I want to achive: Establish a JMS-Connection to an TIBCO EMS (MOM), subscribe for a given topic and write the recived message to the filesystem as xml file. The given folder is a mounted netdrive and further applications will look up for new files inside the given folder, this is due to legacy code and I don't want (dont have the time) to change the folder lookup for e.g. a soap calls.
What I've already done: I've read through the latest documentation and found this one:
Configure with Tibco EMS
After some try and error I think I've achived to setting up the JMS Listener for the TIBCO EMS. At the beginning I've received a bunch of connection and auth errors which are fixed now, so I think the general connection to the tibco server works.
<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
<parameter name="TopicConnectionFactory" locked="false">
<parameter locked="false" name="java.naming.factory.initial">com.tibco.tibjms.naming.TibjmsInitialContextFactory</parameter>
<parameter locked="false" name="java.naming.provider.url">tcp://172.123.123.123:123</parameter>
<parameter locked="false" name="java.naming.security.principal">user</parameter>
<parameter locked="false" name="java.naming.security.credentials">pass</parameter>
<parameter locked="false" name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
<parameter locked="false" name="transport.jms.JMSSpecVersion">1.0.2b</parameter>
<parameter locked="false" name="transport.jms.ConnectionFactoryType">topic</parameter>
<parameter locked="false" name="transport.jms.UserName">user</parameter>
<parameter locked="false" name="transport.jms.Password">pass</parameter>
<parameter locked="false" name="transport.jms.CacheLevel">session</parameter>
</parameter>
</transportReceiver>
I think the next step would be to subscribe to the specific topic and write it to the filesystem but I'm kind of stuck here. The other examples in the documentation sadly doesn't help me here, maybe I'm missing the big picture how to continue here because I'm quite new to the esb / ei product.
I simply don't know which functional component is needed (endpoint, proxy, to make use of the configured jms connection and how to write it to the filesystem.
It would be great if someone could push me into the right direction.
kind regards

First you need to have a JMS proxy or a inbound endpoint to listen on your queue. Refer [1]. Then you need to use the file processing capabilities of WSO2 ESB (VFS transport). Refer [2] on fileWriteSequence sequence.After receiving a message from the queue, you should invoke this type of a sequence in your proxy service or the inbound endpoint.
[1] - https://docs.wso2.com/display/ESB500/ESB+as+a+JMS+Consumer
[2] - https://docs.wso2.com/display/ESB500/Sample+271%3A+File+Processing#Sample271:FileProcessing-CreateandConfigurefileWriteSequence

Related

Disable SSLv3 on WSO2 WSAS 3.1

I am administering an instance of WSO2 WSAS 3.1. After searching for the documentation, I couldn't find anything related to how to change ssl/tls protocols.
Does anyone knows how can I disable the SSLv3 in this version of WSO2 WSAS?
Thanks in advance
To solve the problem I had to change the SSL/TLS protocols in [wso2_home]/conf/transports.xml
FROM:
<transport name="https" class="org.wso2.carbon.server.transports.http.HttpsTransport">
<parameter name="port">9443</parameter>
<parameter name="sslProtocol">TLS</parameter>
TO:
<transport name="https" class="org.wso2.carbon.server.transports.http.HttpsTransport">
<parameter name="port">9443</parameter>
<parameter name="sslProtocols">SSLv2Hello,TLSv1</parameter>
Then stop and start the service.

Support for adding exchange email account with EMM

I have tried searching, but it does not seem the question has been asked anywhere.
Is there any way to configure Exchange account from EMM?
I know you can set up POP3/IMAP-mail.
What would have to be done to implement such feature?
Best regards
EMM can send email invites, and to send smtp server needs to exist. we can configure smtp sever via the axis2.xml available within repository/conf/axis2
<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
<parameter name="mail.smtp.host">smtp.gmail.com</parameter>
<parameter name="mail.smtp.port">587</parameter>
<parameter name="mail.smtp.starttls.enable">true</parameter>
<parameter name="mail.smtp.auth">true</parameter>
<parameter name="mail.smtp.user">synapse.demo.0</parameter>
<parameter name="mail.smtp.password">mailpassword</parameter>
<parameter name="mail.smtp.from">synapse.demo.0#gmail.com</parameter>
</transportSender>
based on exchange server support for SMTP your scenario should be possible.
Please refer the below document[1] for configuration to send out emails to users that register with EMM
https://docs.wso2.com/display/EMM210/Android+Device

WSO2 ESB Issue with Tibco EMS 8.0 integration

I tried to enable JMS transport on WSO2 ESB with Tibco EMS.
With Tibco BW 6.3.0 - copied the below client jars to {wso2esb-4.8.0}\repository\components\lib
tibjms.jar, jms.jar - working without any issues.
With Tibco EMS 8.0 -copied the below client jars to {wso2esb-4.8.0}\repository\components\lib
tibjms.jar, jms-2.0.jar - Results exception as ClassNotFound.
As per WSO2 ESB documentation, it supports only JMS 1.1 and 1.0.2b spec. So tried with Combination of jars.
https://docs.wso2.org/display/ESB481/JMS+Transport#JMSTransport-JMSConnectionFactoryParameters
i.e. Jms.jar from Tibco-6.3.0 and tibjms.jar from Tibco 8.0 - Results same exception as ClassNotFound. Below is the exception Stack trace.
java.lang.NoClassDefFoundError: javax/jms/JMSContext
at com.tibco.tibjms.naming.TibjmsContext$Messenger.(TibjmsContext.java:316)
at com.tibco.tibjms.naming.TibjmsContext.lookup(TibjmsContext.java:651)
at com.tibco.tibjms.naming.TibjmsContext.lookup(TibjmsContext.java:491)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at org.apache.axis2.transport.jms.JMSUtils.lookup(JMSUtils.java:583)
at org.apache.axis2.transport.jms.JMSConnectionFactory.(JMSConnectionFactory.java:93)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.loadConnectionFactoryDefinitions(JMSConnectionFactoryManager.java:58)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.(JMSConnectionFactoryManager.java:45)
at org.apache.axis2.transport.jms.JMSSender.init(JMSSender.java:67)
at org.apache.axis2.context.ConfigurationContextFactory.initTransportSenders(ConfigurationContextFactory.java:300)
at org.apache.axis2.context.ConfigurationContextFactory.init(ConfigurationContextFactory.java:231)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:93)
at org.wso2.carbon.core.CarbonConfigurationContextFactory.createNewConfigurationContext(CarbonConfigurationContextFactory.java:65)
at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:398)
at org.wso2.carbon.core.init.CarbonServerManager.start(CarbonServerManager.java:219)
at org.wso2.carbon.core.internal.CarbonCoreServiceComponent.activate(CarbonCoreServiceComponent.java:77)
Trasport Configuration in axis2.xml
<transportReceiver class="org.apache.axis2.transport.jms.JMSListener" name="jms">
<parameter locked="false" name="ESB-POC-CF-00">
<parameter locked="false" name="java.naming.factory.initial">com.tibco.tibjms.naming.TibjmsInitialContextFactory</parameter>
<parameter locked="false" name="java.naming.provider.url">tcp://127.0.0.1:7222</parameter>
<parameter locked="false" name="java.naming.security.principal">admin</parameter>
<parameter locked="false" name="java.naming.security.credentials"/>
<parameter locked="false" name="transport.jms.ConnectionFactoryJNDIName">ESB-POC-CF-00</parameter>
<parameter locked="false" name="transport.jms.JMSSpecVersion">1.1</parameter>
<parameter locked="false" name="transport.jms.ConnectionFactoryType">queue</parameter>
<parameter locked="false" name="transport.jms.UserName">xprk119</parameter>
<parameter locked="false" name="transport.jms.Password">esb119</parameter>
</parameter>
As Tibco 8.0 support backward compatibility. we are interested to integrate esb with tibco 8.0 version. Please let me know the way to resolve this issue.
You have to include also jms-2.0.jar that comes in EMS 8.0 distribution. That is where your missing class is.
HTH.
I had a similar issue with WebSphere and Tibco 8. Adding both jars - tibjms.jar and ms-2.0.jar to classpath solved the issue
Mahesh.
I had a similar issue some days ago. I think the problem is related with OSGi and the classloaders loading order. I had solved it using the OSGi plugins that comes with EMS 8.2 (I did not know if also with previous 8.x), and referencing them from the plugins that need them.

SOAP-request isn't dispatched by QName of the first body child element

I have a service described with this WSDL. When its operation createService is invoked with this request everything is fine. For this service a proxy service has been made on WSO2 ESB 4.6.0. Here is WSDL generated by ESB for the proxy service. When I try to send the same request to the proxy service with soapUI the following error occurs:
The endpoint reference (EPR) for the Operation not found is
/services/test.testHttpSoap11Endpoint and the WSA Action = . If this
EPR was previously reachable, please contact the server administrator.
Sending this request's body with ESB's proxy service testing tool I have no problem. I think it's because this tool uses WS-Addressing to send it. The request is also sent smoothly with soapUI if endpoint URL is appended by ?createRequest. According to this article a cause of the problem is SOAPMessageBodyBasedDispatcher. For some reason it doesn't recognize target operation by QName of the first child of the SOAP body element. But I can't understand why SOAPMessageBodyBasedDispatcher screws up in my case. Any ideas?
The main difference among WSO2 ESB 4.6.0 and earlier versions is WSO2 ESB 4.6.0 enable Passthrough Transport (PTT) by default. PTT is used to achieve very high performance boost in WSO2 ESB you can find some numbers here http://wso2.org/library/articles/2013/01/esb-performance-65.
The main problem with your use case is it expect SOAPMessageBodyBasedDispatcher to dispatch operation name. SOAPMessageBodyBasedDispatcher build the message and use first child's local name for dispatching this operation is considered as very costly and hence for the moment not supported in PPT. For the time being you can send expected SOAPAction as a HTTP header to get rid of this issue. In this thread I have provided few other solutions Error accesing published WS proxy in WSO2 ESB 4.6: EPR not found
Changing httpGetProcessor won't help here you have to change transportSender and transportReceiver configuration. You can comment out existing PTT transportSender/transportReceiver and uncomment NHTTP transportSender/transportReceiver configurations on axis2.xml file.
This is what you have on ESB 4.6.0
<transportSender name="http" class="org.apache.synapse.transport.passthru.PassThroughHttpSender">
<parameter name="non-blocking" locked="false">true</parameter>
</transportSender>
<transportReceiver name="http" class="org.apache.synapse.transport.passthru.PassThroughHttpListener">
<parameter name="port" locked="false">8280</parameter>
<parameter name="non-blocking" locked="false">true</parameter>
<parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.PassThroughNHttpGetProcessor</parameter>
</transportReceiver>
What you need is
<transportReceiver name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOListener">
<parameter name="port" locked="false">8280</parameter>
<parameter name="non-blocking" locked="false">true</parameter>
<parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.NHttpGetProcessor</parameter>
<parameter name="disableRestServiceDispatching" locked="false">true</parameter>
</transportReceiver>
<transportSender name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender">
<parameter name="non-blocking" locked="false">true</parameter>
</transportSender>

AXIS2: JNDI lookup of name ConnectionFactory returned a org.jboss.mq.SpyConnectionFactory while a interface javax.jms.ConnectionFactory was expected

I installed a fresh WSO2 ESB version 4.2.3 (last stable up to now) and I configured the JMS transport in the axis2.xml file as following:
<!-- Configuration for JBoss 4.2.2 GA MQ -->
<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
<parameter name="SMSOUTQueueConnectionFactory" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.jnp.interfaces.NamingContextFactory</parameter>
<parameter name="java.naming.factory.url.pkgs" locked="false">org.jboss.naming:org.jnp.interfaces</parameter>
<parameter name="java.naming.provider.url" locked="false">jnp://192.168.10.125:1100</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">ConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
<parameter name="transport.jms.Destination" locked="true">queue/SMSOUTQueue</parameter>
</parameter>
</transportReceiver>
Immediately after, during the startup an error has been found:
15:09:16,585 INFO [STDOUT] 15:09:16,585 ERROR [BaseUtils] JNDI lookup of name ConnectionFactory returned a org.jboss.mq.SpyConnectionFactory while a interface javax.jms.ConnectionFactory was expected
15:09:16,587 INFO [STDOUT] 15:09:16,585 ERROR [ListenerManager] Couldn't initialize the jmstransport listener
org.apache.axis2.transport.base.BaseTransportException: JNDI lookup of name ConnectionFactory returned a org.jboss.mq.SpyConnectionFactory while a interface javax.jms.ConnectionFactory was expected
at org.apache.axis2.transport.base.BaseUtils.handleException(BaseUtils.java:167)
at org.apache.axis2.transport.jms.JMSUtils.lookup(JMSUtils.java:522)
at org.apache.axis2.transport.jms.JMSConnectionFactory.<init>(JMSConnectionFactory.java:92)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.loadConnectionFactoryDefinitions(JMSConnectionFactoryManager.java:58)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.<init>(JMSConnectionFactoryManager.java:45)
at org.apache.axis2.transport.jms.JMSListener.doInit(JMSListener.java:58)
at org.apache.axis2.transport.base.AbstractTransportListenerEx.init(AbstractTransportListenerEx.java:62)
at org.apache.axis2.engine.ListenerManager.init(ListenerManager.java:84)
at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:386)
at org.wso2.carbon.core.init.CarbonServerManager.removePendingItem(CarbonServerManager.java:273)
at org.wso2.carbon.core.init.PreAxis2ConfigItemListener.bundleChanged(PreAxis2ConfigItemListener.java:117)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:916)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:220)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:330)
I found a lot of posts where people say to remove the ...WEB-INF/lib/geronimo-jms_1.1_spec-1.1.0.wso2v1.jar, because otherwise synapse doesn't work with any external JMS broker (I found same answer also for Mule ESB), but for me this solution doesn't work.
The problem is very similar to this link.
Any help is very appreciated. Thanks a lot in advance.
This is a bit late reply. But I also encountered same error and able to fix.When trying to connect to a JMS queue deployed in a JBoss Server from WSO2 ESB 4.6.0 and even with removing the jar geronimo-jms_1.1_spec-1.1.0.wso2v1.jar,your mentioned issue was not fixed.
The reason for that is,in your added jboss related jars to ESB/repository/components/lib,there are some other jars,exposing the implementation for javax.jms.. For example in my case there were two additional jars called jboss-j2ee.jar and jbossall-client.jar exposing javax.jms.. What I did was I opened the two jars and removed the exposing package part of javax.jms.* from both.Then the issue was fixed.
Thanks;