I have created VFS based proxy service as below but property startOnLoad="false" is not working as expected. Even after the deployment of the proxy, we need to manually click Activate and then click disable to permanently disable VFX proxy.
But the proxy status show as disabled but the proxy is still polling FTP server in the back end. We need to manually activate and disable the proxy to permanently disable it.
Is there anyone faced this problem earlier and any fix for it.
This issue is in WSO2 ESB 5.0
Below is my proxy configuration
<proxy name="MFTProxy" startOnLoad="true" trace="disable" transports="vfs" xmlns="ws.apache.org/ns/synapse">
<parameter name="transport.vfs.FileProcessCount">1</parameter>
<parameter name="transport.vfs.ActionAfterProcess">NONE</parameter>
<parameter name="transport.PollInterval">60</parameter>
<parameter name="transport.vfs.SFTPUserDirIsRoot">false</parameter>
<parameter name="transport.vfs.FileURI">vfs:sftp://XXXXXXX:password#host/outbox</parameter>
<parameter name="transport.vfs.Locking">disable</parameter>
</proxy>
Related
How can WSO2 pick up messages from ActiveMQ without calling any WSO2 api or proxy by client application?
[Please note:- Source System will send messages through ActiveMQ and WSO2 will have to pick up those messages]
Can anybody provide any solution?? I am clueless...
you need to:
Configure wso2 esb to work with activemq...copy /lib
directory to < ESB_HOME>/repository/components/lib
Enable and configure JMSReceiver and JMSSender for Activemq in conf/axis2/axis2.xml. uncomment the configuration for activemq.
The wso2 esb proxy need jms transport active inside it configuration.
configure this parameters after target section inside proxy configuration:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="ForwardProxy" startOnLoad="true" statistics="disable" trace="disable" transports="jms1">
<target>
</target>
<parameter name="transport.jms.DestinationType">queue</parameter>
<parameter name="transport.jms.Destination">yourQueue</parameter>
<parameter name="transport.jms.ContentType">
<rules xmlns="">
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
</rules>
</parameter>
<parametername="transport.jms.ConnectionFactory">
myQueueConnectionFactory
</parameter>
</proxy>
create yourQueue inside activeMQ.
put a message in yourQueue.
I am pretty new in WSO2 ESB and I have the following problem.
Into my ESB flow I have a Store mediator that put an XML document ino a WSO2 MB queue, this is the configuration of my message store:
<?xml version="1.0" encoding="UTF-8"?>
<messageStore class="org.apache.synapse.message.store.impl.jms.JmsStore" name="glisMessageStore" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="store.jms.destination">glisQueue</parameter>
<parameter name="store.producer.guaranteed.delivery.enable">false</parameter>
<parameter name="store.jms.cache.connection">true</parameter>
<parameter name="java.naming.factory.initial">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="connectionfactory.QueueConnectionFactory">amqp://admin:admin#clientID/carbon?brokerlist='tcp://localhost:5675'</parameter>
<parameter name="store.jms.JMSSpecVersion">1.1</parameter>
</messageStore>
As you can see my documents are putted into the glisQueue queue.
Then I deployed (with this project) a Message Processor named glisMessageProcessor that check if the queue is not empty and if it contains some XML documents it send to and external web service performing an Http call, this is the configuration of my message processor:
<?xml version="1.0" encoding="UTF-8"?>
<messageProcessor class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor" messageStore="glisMessageStore" name="glisMessageProcessor" targetEndpoint="glisEndpoint" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="client.retry.interval">1000</parameter>
<parameter name="max.delivery.attempts">4</parameter>
<parameter name="member.count">1</parameter>
<parameter name="message.processor.reply.sequence">glisResponseSequence</parameter>
<parameter name="max.delivery.drop">Disabled</parameter>
<parameter name="interval">1000</parameter>
<parameter name="is.active">true</parameter>
</messageProcessor>
As you can see it is using the glisMessageStore as data source (so it is using the glisQueue queue defiend in it to obtain the data to send) and send these data to the glisEndpoint that is the endpoint of my web service (it is defined in my project).
It works fine, the data are correctly sended to the external web service represented by the glisEndpoint.
My only problem is: my web service returns a message when is called (containing some information that I need to store in some way).
Can I configure in some way my glissMessageProcessor to retrieve these response message and put it in a log file?
You just have to use log mediator inside the sequence named "glisResponseSequence" : this is what you've defined with "message.processor.reply.sequence" parameter ant this is where goes the response.
I am currently trying to set up a vfs proxy which works fine on a local ftp server. The problem is that our company internet access is blocked by a proxy so I am searching for how to specify this proxy information. As far as I know JSCH is used underneath but I haven't found a way to pass the proxy parameter.
Here is my current proxy xml:
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="ftpCollection" statistics="disable" trace="disable" transports="vfs">
<target>
<inSequence>
<clone>
<target sequence="processSeq"/>
</clone>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
<parameter name="transport.vfs.ReplyFileURI">vfs:sftp://user:pw#192.168.2.99:22/reply</parameter>
<parameter name="transport.PollInterval">15</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.FileProcessInterval">100</parameter>
<parameter name="transport.vfs.FileURI">vfs:sftp://user:pw#192.168.2.99:22/process/</parameter>
<parameter name="transport.vfs.MoveAfterProcess">vfs:sftp://user:pw#192.168.2.99:22/success/</parameter>
<parameter name="transport.vfs.MoveAfterFailure">vfs:sftp://user:pw#192.168.2.99:22/failure/</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.xml</parameter>
<parameter name="transport.vfs.Locking">disable</parameter>
<parameter name="transport.vfs.ContentType">application/xml</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
<parameter name="transport.vfs.MoveTimestampFormat">yyyy-MM-dd'T'HH:mm:ss.SSS</parameter>
</proxy>
Thanks
SFTP (SSH) through a proxy does work over a HTTP tunnel. You can do that with JSch described on this page.
Now already the VFS transport in WSO2 (which finally uses JSch) does not have an implementation of the HTTP tunneling. So you cannot use a simple VFS WSO2 ProxyService to do that.
You can solve it by implementing your own wso2esb transport listener. Have a look at the code of VFSTransportListener.java (or just copy/paste) and code the JSch access over http yourself. You can then add the transport in the axis2.xml configuration of your wso2esb.
Hi Followed the blog mentioned in SMS Transport sender in wso2 ESB and configured axis2.xml for transportSender and transportReceiver. I am able to send a message from ESB to SMPP simulator but I am unable to receive message from SMPP simulator to ESB.
In the SMPP Simulator, I tried by adding bot 't'/'r' to enable transmitter/receiver and also tried by giving tr assuming that it is for tranceiver in users.txt but still I am unable to get a response in ESB.
Could you please help in implementing SMPP -> ESB scenario. Any link that describes this procedure also helpful for me. ( I am unable to find such)
I am editing this to make my scenario more clear
My simulator is opensmpp-sim. I added the user details in user.txt as
name=esb
password=esb
timeout=unlimited
bound=t,r
I executed the simulator with port 2775.
In ESB, axis2.xml I gave the following configurations
Transport Receiver
<transportReceiver name="sms" class="org.apache.axis2.transport.sms.SMSMessageReciever">
<parameter name="systemType">cp</parameter>
<parameter name="systemId">esb</parameter>
<parameter name="password">esb</parameter>
<parameter name="host">192.168.0.2</parameter>
<parameter name="port">2775</parameter>
<parameter name="phoneNumber">94777179968</parameter>
</transportReceiver>
Transport Sender
<transportSender name="sms" class="org.apache.axis2.transport.sms.SMSSender">
<parameter name="systemType">cp</parameter>
<parameter name="systemId">esb</parameter>
<parameter name="password">esb</parameter>
<parameter name="host">127.0.0.1</parameter>
<parameter name="port">2775</parameter>
</transportSender>
Note: 192.168.0.2 = 127.0.0.1 = localhost
Scenarios
1. Sending a message from ESME (ESB) to SMSC (Simulator)
Sequence
<sequence xmlns="http://ws.apache.org/ns/synapse" name="TEST_SMS">
<send>
<endpoint key="SMSC"/>
</send>
</sequence>
Endpoint
sms://94777179968
I exposed this sequence as a REST API. When I send a message, the message reached Simulator but there is no response in return.
2. Sending a message from SMSC (Simulator) to ESMC (ESB)
From simulator when I send message, it reaches ESB. In debug mode the message is printed in ESB log. But I am unable to handle it. How can I configure proxy service/ sequence to get that message. My goal is to get that message and initiate a process.
Thanks in advance.
i am testing some sample use cases with WSO2 where the ESB must scan an SFTP folder and perform some actions. Here is what i did:
1) I enabled the VFS transport listener in axis2.xml:
<transportReceiver name="vfs" class="org.apache.synapse.transport.vfs.VFSTransportListener"/>
<transportSender name="vfs" class="org.apache.synapse.transport.vfs.VFSTransportSender"/>
2) I inserted the following proxy (i have changed user:pass for obvious reasons) :
<proxy xmlns="http://ws.apache.org/ns/synapse" name="SFTPVFSProxy" transports="vfs" statistics="disable" trace="enable" startOnLoad="true">
<target>
<inSequence>
<log level="full" />
</inSequence>
</target>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.PollInterval">3</parameter>
<parameter name="transport.vfs.MoveAfterProcess">vfs:sftp://user:pass#10.254.241.69:22/home/user/sftp/out</parameter>
<parameter name="transport.vfs.FileURI">vfs:sftp://user:pass#10.254.241.69:22/home/user/sftp/in</parameter>
<parameter name="transport.vfs.MoveAfterFailure">vfs:sftp://user:pass#10.254.241.69:22/home/user/sftp/out</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.txt</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
</proxy>
In both versions 4.5.0 & 4.5.1 nothing is triggered. No output in the log files other than some info that the proxy was successfully deployed. The exact same script works in version 3.0.1.
Furthermore, if i change "sftp" to "ftp" or to local file the listener is triggered normally in v4.X as well which makes me believe it's probably something specific to sftp handling.
Am i doing something wrong or is there a bug in the software?
Thank you in advance,
Thodoris
I think the problem is with the way you have defined the transport.vfs.FileURI property. Assuming your user's username is "user", then when you log in to sftp you go to the /home/user folder. Therefore, try defining the above property as follows.
<parameter name="transport.vfs.FileURI">vfs:sftp://user:pass#10.254.241.69:22/sftp/in</parameter>
or
<parameter name="transport.vfs.FileURI">vfs:sftp://user:pass#10.254.241.69:22/in</parameter>
I cannot say the exact config because I dont know your folder structure.
I have tried this in WSO2 ESB 4.0.3 with SFTP. My username was amilaftp. So I defined the property as follows.
<parameter name="transport.vfs.FileURI">vfs:sftp://amilaftp:password#localhost/in?vfs.passive=true</parameter>
When you try with FTP, you need to give the full path as you have done in the configuration you have provided. Thats why it is working for you with FTP in WSO2 ESB 4.X. If this works for you in 4.0.3, this should work in 4.5.x too. I suggest you to try with 4.0.3 first because it has worked for me.