Using Anypoint Studio to Configure Hadoop (HDFS) Connector - Mule 4
Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files.
To add and configure a connector in Studio:
-
Create a Mule project.
-
Add the connector to your Mule project
-
Configure an input source for the connector’s flow.
-
Configure global elements for the connector.
If you are new to configuring Anypoint Connectors in Studio, see Using Anypoint Studio to Configure a Connector.
Create a Mule Project
In Anypoint Studio, create a new Mule project in which to add and configure the connector.
-
In Anypoint Studio, from the main menu, select File > New > Mule Project.
-
Enter a name for your Mule project, and click Finish.
Add the Connector to Your Mule Project
Add Hadoop (HDFS) Connector to a Mule project to automatically populate the XML code with the connector’s namespace and schema location, as well as add the required dependencies to the project’s pom.xml
file.
-
In the Mule Palette view, click (X) Search in Exchange.
-
In Add Modules to Project, type
hdfs
in the search field. -
Click the name of the connector in Available modules.
-
Click Add.
-
Click Finish.
Adding a connector to a Mule project in Studio does not make that same connector available to other projects in your Studio workspace.
Configure an Input Source
An input source initiates a flow when a specified condition is met. The act of dragging the connector’s operation from the palette onto the Anypoint Studio canvas automatically populates the XML code with the connector namespace and schema location.
Possible input source operations for this connector are:
-
Read
Starts your app when the content of a file is read and streamed to the rest of the flow. -
HTTP Listener
Starts your app using a browser or a command such ascurl
. -
Scheduler
Starts your app at timed intervals.
In Studio, drag the input operation you choose from the Mule Palette to the Source panel in the canvas, and supply the required parameters.
For example, the required fields for the Read
input source are:
-
Configuration
The name of the connector configuration to use -
Path
The path for the file to read
Configure a Global Element for the Connector
To configure a connector in your Mule app, configure a global element that can be used by all instances of that connector in the flow:
-
In the Mule Palette view, search for the connector and select an operation.
-
Drag the operation onto the canvas to the right of the input source.
-
In the configuration screen for the operation, click the plus sign (+) next to the Connector configuration field to add a global element for the connector.
-
In the General tab, enter a name for the configuration, and select the connection type from Connection.
Supported connection types for this connector are:-
For information about how to configure the connections, see Connection Types.
You can provide your credentials in the global configuration properties, or you can reference a configuration file that contains those values.
To simplify maintenance and improve project reusability, of your project, use a configuration file. Keeping these values in a separate file is useful if you need to deploy to different environments, such as production, development, and QA, where your access credentials differ.
See Anypoint Connector Configuration for more information.
-
Click the Advanced tab to specify a reconnection strategy, if supported.
-
Click Test Connection to confirm that Mule can connect with the specified server.
-
Click OK.