How to connect sftp using mule requestor in mule 3.9 - mule

How to connect SFTP using mule requestor in mule 3.9?
How to create a source path
Wanted to know hoe to connect to sftp using mule requester

You can to configure the resource attribute as the URL for an SFTP endpoint:
<mulerequester:request resource="sftp://${USER_NAME}:${PASSWORD}#${SFTP_HOST}:${SFTP_PORT}/path/to/file" doc:name="Mule Requester"/>
All values in the URL need to be URL encoded. This is usually only a problem for passwords that have special characters in it.
Alternative you can define a global SFTP endpoint and reference it in the resource attribute by name.
In Mule 4 the Mule Requester Module is not supported and not needed because most Mule 4 connectors provide equivalent operations to use inside flows in a supported way.

Related

Mulesoft IBM MQ connector publish-consume operation equivalent in Mule 3.9?

I am building an api which is supposed to send message to an IBM MQ and receive the response from another queue. But the operation has to appear synchronous to the caller of the api. I'm using Mule 3.9.2.
Seems Mule 4 has a connector called IBM MQ connector which has a publish conume operation to achieve this - https://docs.mulesoft.com/ibm-mq-connector/1.6/ibm-mq-publish-consume. But how do i get this done in Mule 3.9.2.
I'm currently trying to get this done with the WMQ connector and using a request-reply pattern but with no success.
Tried using request-reply,
Also had it on a separate flow,
Got it working by using the request-response exchange pattern available in the WMQ connector in 3.9.

Can we have a way to integrate control-m with mule?

We have a requirement where we want mule to be invoked with fixed frequency we want to utilise control-m for that.
If the Control-M agent is running on your Mule ESB server, then you can use it to invoke a script which uses curl to invoke an http inbound endpoint flow, or to send a JMS message for a Mule flow with a JMS inbound endpoint, or place a file in a directory for a file inbound endpoint, etc... You get the idea, right? Any of the inbound endpoints are a possible candidate for the kickoff. Whether you are running Mule under Windows or Nix is another question as well, but it will work either way with some mods as to the scripting approach.

connecting mule ESB to Apache web server

How to access the data packets routed to apache webserver in Mule ESB flow.
After I call the exposed webservice, the webservice sends two responses,
To mule server
Routes response XML as data packets to apache webserver.
Can someone help in how to proceed with second flow? Thanks.
Use a Java library that understands PCAP and create your own Mule connector around it.
Reference:
List of Java PCAP libraries: https://en.wikipedia.org/wiki/Pcap#Wrapper_libraries_for_libpcap.2FWinPcap
Mule connector development kit: https://developer.mulesoft.com/docs/display/current/Anypoint+Connector+DevKit

Some concept questions on Mulesoft

I have some questions on concepts of Mulesoft. If you could answer that would be appreciated.
1.When mule connects to an FTP server and checks for new files,does Mule by default deletes the file once it is downloaded? And can FTP is available both as polling and as event subscription based?
When we connect to a RESTful service over HTTP, can Dynamic endpoints select whether HTTP or HTTPS is used or can be used to set the Host, Port and Path? (multiple choice for this question: a. Dynamic endpoints can select what transport to use. b. The Host, Port and Path can be set using dynamic endpoint. c. Dynamic endpoint can select whether HTTP or HTTPS is used. Which one is correct?)
in configuration, if
is used, does it mean my1.properties will take precedence?
Thanks!
1a) Community FTP connector will always delete the remote file. Enterprise FTP connector allows you to move it to another folder.
1b) Reading FTP connector is only available as a polling mechanism to read files from a FTP server.
2) The only part that can not be dynamic is the scheme, but you could place two connectors (one for HTTP and another for HTTPS) inside a choice and select which one to use dynamically.
3) I didn't get this, please elaborate a bit more.
HTH,
Marcos
Yes, it does. Mule EE give more features as you can see in the documentation FTP is always polling the directory.
You can setup HTTP or HTTPS. But, you can use a composite-source and tell that your flow is available for HTTP and HTTPS.
I know that it is possible, I found time ago the same requirement for FTP in mule forum. Hope this help
<!-- streaming to prevent deleting remote file -->
<ftp:connector name="ftpConnector" streaming="true" />
<flow name="ftpBridge">
<vm:inbound-endpoint path="fetchFtpFile" exchange-pattern="request-response"/>
<scripting:component>
<scripting:script engine="groovy">
def ftpFileUri = "ftp://${payload.userName}:${payload.password}#${payload.host}${payload.path}?fileNameFilter=${payload.fileName}"
muleContext.client.request(ftpFileUri, 30000L);
</scripting:script>
</scripting:component>
</flow>
If you want to load properties you can use spring to do that. Review this link.

How can I test a flow with ActiveMq in local

I'm started to work with Mule and Mule Studio (version 3.5): my goal is rewriting some flows that now is workign, but with a bad syntax.
In this moment I have a flow with some JMS connector and JMS endpoint for acquiring data (my flows are using ActiveMQ 5.10): the configuration XML file is ok and I want to test this flow, but I have'nt a big experience in JMS and system integration.
I think to create a JMS producer and, into run,
start up Mule (with all his flows, endpoints, etc, JMS queues);
start the JMS producer: in run the producer
links to name queue defined in configuration Mule
create a message
send this message to Mule
And the test asserts the
Mule receive the message by the producer
Mule don't loss the message
Mule turn this message to correct flow and relative elaboration
My problem is the lack of manuality and pratical work-ability to link Mule and producer: I tried to use http://activemq.apache.org/hello-world.html but the code is useless for me because it work correctly without Mule, but in my case the tests has to fail if Mule is stopped.
Has everybody any suggest, please?
Just set up an activemq connector without addresss, that will use the default address of vm://localhost that instructs the connector and activemq to act as a local embedded server.
<jms:activemq-connector name="JmsConnector" specification="1.1" />