Some concept questions on Mulesoft - mule

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.

Related

How to connect sftp using mule requestor in mule 3.9

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.

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

Starting the mule without mule-config.xml and to load the mule-config programatically

I am having a requirement like interacting the mules from different machines.I used the tcp inbound endpoint it is working perfectly if I configure everything in the mule-config.xml.Now my problem is i dont want to use the mule-config.xml but I want to load it programmatically.if any one have the solution pls update..
Thask.
The whole point of using Mule is that you can configure your flows simplistically, rather than writing complex code yourself. Having said that you can programmatically configure endpoints provided they are
outbound endpoints.
OR you using mulerequester:request
You cannot programmatically configure inbound endpoint.

How to configure a running Mule service's properties dynamically?

I would like a recommendation/idea on a method to configure properties for a running Mule service dynamically, i.e. I want the service to pick up the new settings without the need to restart Mule. Typically the kind of properties/settings I would like to change are FTP connector user ID, passwords, service URLs etc.
Any idea would be welcome.
Regards, Ola
Use the URI endpoint format do dynamically address endpoints. In simple cases you may be able to use the message properties in a TemplateEndpointRouter
Otherwise You need to write a component that composes the URI and sends the message to the dynamic endpoint using the MuleEventContext or MuleClient.
See here:
http://www.mulesoft.org/documentation/display/MULE2USER/Outbound+Routers#OutboundRouters-TemplateEndpointRouter
http://www.mulesoft.org/documentation/display/MULE2USER/Using+the+Mule+Client#UsingtheMuleClient-PerforminganEventRequestCall
http://www.mulesoft.org/documentation/display/MULE2USER/Mule+Endpoint+URIs
Mule exposes all service configuration via JMX, but I don't see any obvious way to reconfigure the connectors without a restart. They are internally managing pools of connections.
If there is a limited, you can create connectors for each and reconfigure the routes via jmx attributes.
If it is to be fully dynamic you likely need to implement your own service component to manage the ftp connection. Exposing the connection management, configuration, and restarting via JMX should be pretty straight forward.