BassemE/mulesoft-documentation-embeddings huggingface dataset:
Einstein AI Connector 1.2 XML and Maven Support | MuleSoft Documentation
# Einstein AI Connector 1.2 XML and Maven Support
Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Code Builder or Studio:
  * If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Code Builder or Studio XML editor, or from a text editor, you can access the connector from your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file.
  * If you add the connector in Anypoint Code Builder or Studio, the XML is automatically populated the code with the connector’s namespace and schema location and it also adds a dependency to the `pom.xml` file.


## Add a Namespace for the Connector
Paste the following code inside the `mule` tag of the header of your configuration XML:
```
http://www.mulesoft.org/schema/mule/ms-einstein-ai
http://www.mulesoft.org/schema/mule/ms-einstein-ai/current/mule-ms-einstein-ai.xsd
```

This example shows how the namespace statements are placed in the `<mule>` XML block:
```
<mule xmlns:ms-einstein-ai="http://www.mulesoft.org/schema/mule/ms-einstein-ai"
  xmlns:http="http://www.mulesoft.org/schema/mule/http"
	xmlns="http://www.mulesoft.org/schema/mule/core"
	xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
	http://www.mulesoft.org/schema/mule/core/current/mule.xsd
  http://www.mulesoft.org/schema/mule/http
	http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
  http://www.mulesoft.org/schema/mule/ms-einstein-ai
	http://www.mulesoft.org/schema/mule/ms-einstein-ai/current/mule-ms-einstein-ai.xsd">
```

## Add a POM File Dependency
The Apache Maven `pom.xml` file generated by Anypoint Code Builder and Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector:
```
<dependency>
	<groupId>com.mulesoft.connectors</groupId>
	<artifactId>mule4-einstein-ai-connector</artifactId>
	<version>x.x.x</version>
	<classifier>mule-plugin</classifier>
</dependency>
```

Replace `x.x.x` with the version that corresponds to the connector you’re using.
To get the most up-to-date `pom.xml` file information:
  1. Go to Anypoint Exchange.
  2. In Exchange, click **Login** and supply your Anypoint Platform username and password.
  3. In Exchange, search for `einstein ai`.
  4. Select the connector.
  5. Click **Dependency Snippets** near the upper right of the screen.


## See Also
  * Einstein AI Connector Overview
  * Einstein AI Connector Reference
  * Einstein AI Connector - Additional Configuration
fromRadixNumber | MuleSoft Documentation
# fromRadixNumber
## fromRadixNumber(numberStr: String, radix: Number): Number
Transforms a number in the specified radix into decimal number
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
`numberText` | The number text.  
The radix number.  
### Example
This example shows how the `fromRadixNumber` behaves under different inputs.
#### Source
```
%dw 2.0
import fromRadixNumber from dw::core::Numbers
output application/json
---
{
  a: fromRadixNumber("10", 2),
  b: fromRadixNumber("FF", 16)
}
```

#### Output
```
{
 "a": 2,
 "b": 255
}
```
Using CloudHub | MuleSoft Documentation
# Using CloudHub
Anypoint Runtime Manager allows you to deploy your Mule application to different deployment targets, such as an on-premises server and CloudHub. Using CloudHub implies the following:
  * Developing applications for CloudHub, by following certain specific considerations.
  * Deploying to CloudHub, by means of a variety of tools you can choose from.
  * Viewing log data, including deployment messages and events for each worker and Mule runtime engine logs.
  * Integrating with your logging system, by configuring logs to flow to your log system with the Log4j configuration, after which you can disable CloudHub logs.
  * Managing CloudHub-specific settings, including regions, subscription levels and plan types.
Assembling Dashboards | MuleSoft Documentation
# Assembling Dashboards
Arrange important widgets on a dashboard.
## Before You Begin
  * Ask an organization administrator in Access Management to assign you the required permissions:
Action | RPA Permission | Deprecated RPA Permission  
---|---|---  
Open the **Dashboard** module. | RPA Operations Viewer, RPA Operations Manager, RPA Administrator | Dashboard Open  
Manage dashboards. | RPA Operations Manager, RPA Administrator | Dashboard Administration  


## Create a Dashboard
Create a dashboard that shows you the progress of your automation management within a defined time period on one page.
  1. In the **Private Dashboards** view of the **Dashboard** module, click **Create**.
  2. Complete the form **Create a Private Dashboard** and click **OK**.
  3. In your new dashboard, click **Add Widget** and select one from the Dropdown.
  4. Repeat the previous step until you added all necessary widgets.
  5. Arrange the widgets by dragging and dropping them onto the dashboard.
  6. Configure widgets by clicking on the **Configure** icon.
  7. Click on the time frame string in the header of the page to adjust the time interval of the retrieved data.
  8. Click **Save**


## Publish a Dashboard
Publish a Dashboard to share it with your colleagues. Published dashboards are copied and not synched with the private dashboards they are derived from.
  1. In the **Private Dashboard** view of the **Dashboard** module, click the **Publish** icon in the row of the dashboard you want to publish.
Aggregators Module 1.0 | MuleSoft Documentation
# Aggregators Module 1.0
For compatibility information and fixed issues, see the Aggregator Module Release Notes.
Aggregators Module contains different types of aggregators that use a specified configuration to both store and release values. An _aggregator scope_ is a component that collects those values until a specified condition is met, when it then executes a processor’s chain of components, with the list of aggregated elements as the payload.
The basic aggregator configuration consists of the definition of the value to aggregate (extracted from the message through an expression evaluation), a condition that defines when the aggregation is considered complete, and a processor chain that executes once that condition is met.
Aggregators are pass-through routers. The same data that an aggregator scope receives is processed by the components that follow the aggregator scope. The only modification is variable propagation if any variables are set during the execution of any of the aggregation routes.
## Before You Begin
To use this module, you must be familiar with:
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements and global elements in a Mule flow
  * Creating a Mule app using Anypoint Studio (Studio)


Before creating an app, you must have to Anypoint Platform and Anypoint Studio.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * MuleSoft Help Center
Tips: Transform Message Component UI (Anypoint Studio) | MuleSoft Documentation
# Tips: Transform Message Component UI (Anypoint Studio)
  * Before creating your mapping, configure everything else on the flow so that the input and output is known.
  * To can filter what you see from the input or output structures, click the magnifying glass icon at the top of either section and then start typing the name of a field.
  * Select an element in the output pane to have its corresponding line in the DataWeave code highlighted.
  * If an input field is mapped to two or more output fields, you can right-click it and then select which of the multiple outputs you want to highlight in the DataWeave code.


## See Also
Transform Message Component
Workflow: Create a Mapping
DataWeave Language
Shopify Connector 1.0 | MuleSoft Documentation
# Shopify Connector 1.0
Anypoint Connector for Shopify (Shopify Connector) gives you access to the Shopify platform. This connector exposes operations provided by the Shopify REST Admin API.
For information about compatibility and fixed issues, see the Shopify Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * The Shopify Connector’s API
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements and global elements in a Mule flow
  * Creating a Mule app using Anypoint Studio (Studio)


Before creating an app, you must have:
  * Credentials to access the Shopify target resource
  * Anypoint Platform
  * Anypoint Studio version 7.5.0 or later


## Common Use Cases For the Connector
Some common use cases for Shopify Connector include:
  * Syncing a new customer’s information when they place an order
  * Storing information when a new order is placed through a client’s Shopify store
  * Managing items when new products are created in Shopify


## Connection Types
Shopify Connector uses the following authentication methods:
  * Basic Auth Uses a username and password for authentication.
  * OAuth2 Delegates user authentication to the service hosting the user account.


## Next Step
After you complete the prerequisites, you are ready to create an app and configure the connector using Anypoint Studio.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * Shopify Connector Reference
  * MuleSoft Help Center
Define a Function that Flattens Data in a List | MuleSoft Documentation
# Define a Function that Flattens Data in a List
When presented with nested structures of data, you might need to reduce (or "flatten") the data in them to produce a simpler output.
This DataWeave example flattens the data in the `interests` and `contenttypes` arrays with the function that is defined in the header, and it only outputs `contenttypes` when it is not empty.
The example uses these functions:
  * `map` to go through a set elements in the input.
  * `reduce` to flatten the arrays.
  * `if` to conditionally display a field.
  * `splitBy` to parse the input.


DataWeave Script:
```
%dw 2.0
output application/json
fun reduceMapFor(data) = data reduce (($$ splitBy ":")[0] ++ "," ++ ($ splitBy ":")[0])
---
payload.results map() ->
{
 email: $.profile.email,
 name: $.profile.firstName,
 tags: reduceMapFor($.data.interests.tags[0]),
    (contenttypes: reduceMapFor($.data.interests.contenttypes[0])) if(sizeOf($.data.interests.contenttypes[0]) > 0)
}
```

Input JSON Payload:
```
{
 "results": [
  {
   "profile": {
    "firstName": "john",
    "lastName": "doe",
    "email": "johndoe@demo.com"
   },
   "data": {
    "interests": [
     {
      "language": "English",
      "tags": [
       "digital-strategy:Digital Strategy",
       "innovation:Innovation"
      ],
      "contenttypes": []
     }
    ]
   }
  },
  {
   "profile": {
    "firstName": "jane",
    "lastName": "doe",
    "email": "janedoe@demo.com"
   },
   "data": {
    "interests": [
     {
      "language": "English",
      "tags": [
       "tax-reform:Tax Reform",
       "retail-health:Retail Health"
      ],
      "contenttypes": [
       "News",
       "Analysis",
       "Case studies",
       "Press releases"
      ]
     }
    ]
   }
  }
 ],
 "objectsCount": 2,
 "totalCount": 2,
 "statusCode": 200,
 "errorCode": 0,
 "statusReason": "OK"
}
```

Output
```
[
 {
  "email": "johndoe@demo.com",
  "name": "john",
  "tags": "digital-strategy,innovation"
 },
 {
  "email": "janedoe@demo.com",
  "name": "jane",
  "tags": "tax-reform,retail-health",
  "contenttypes": "News,Analysis,Case studies,Press releases"
 }
]
```

## Related Examples
  * Use Constant Directives
  * Conditionally Reduce a List through a Function
  * Define a Custom Addition Function
  * Pass Functions as Arguments


## See Also
  * DataWeave Selectors
  *
Supported Secret Types Reference | MuleSoft Documentation
# Supported Secret Types Reference
## Simple Secret Types
Secret Type | Description  
---|---  
Shared Secret |  This security object contains a username and password or a base64-encoded symmetric key. The shared secret is used for symmetric encryption and decryption in situations in which the secret is known by both the message sender and the message recipient. The sender uses the key to encrypt and sign the message. The recipient uses the key to decrypt the message and verify a message’s digital signature. The secrets manager enables an administrator to define one of a static username and password combination, a static symmetric key, an S3 bucket, or blobs.  
Certificate |  This security object contains an X.509 certificate and an electronic document that uses a digital signature to bind a public key with an identity. The secrets manager supports PEM and JKS certificates.  
## Secret Types Used in TLS and SSL Communication
Secret Type | Description  
---|---  
A keystore is a repository of security certificates (either authorization certificates or public key certificates), plus corresponding private keys used, for example, in SSL encryption. Secrets manager accepts both keys and certificates signed by RSA and EdDSA (ED448 and ED25519). Supported keystore types are:
  * JCEKS
  * PKCS12

  
A truststore is a repository of security certificates from other parties with which you expect to communicate, or from Certificate Authorities that you trust to identify other parties. Secrets manager accepts truststores with expired certificates. The secrets manager truststore accepts the following standard input formats:
  * PKCS12
  * JCEKS

  
Certificate Pinset |  A Certificate Pinset is a repository of security certificates from other parties that associate a client or host with their expected X.509 certificate or public key. These security certificate identities are then "pinned" to clients or hosts. This repository or "Pin Set" acts as a list of certificates that can be used, for example, to identify clients in a SSL/TLS connection. The secrets manager accepts a concatenated list of PEM certificates as input.  
TLS Context |  This security object defines all SSL critical security parameters.  
## See Also
  *   *   * Secrets Manager Permissions
hashWith | MuleSoft Documentation
# hashWith
## hashWith(content: Binary, algorithm: String = "SHA-1"): Binary
Computes the hash value of binary content using a specified algorithm.
The first argument specifies the binary content to use to calculate the hash value, and the second argument specifies the hashing algorithm to use. The second argument must be any of the accepted Algorithm names:
Algorithm names | Description  
---|---  
The MD2 message digest algorithm as defined in RFC 1319.  
The MD5 message digest algorithm as defined in RFC 1321.  
`SHA-1`, `SHA-256`, `SHA-384`, `SHA-512` | Hash algorithms defined in the FIPS PUB 180-2. SHA-256 is a 256-bit hash function intended to provide 128 bits of security against collision attacks, while SHA-512 is a 512-bit hash function intended to provide 256 bits of security. A 384-bit hash may be obtained by truncating the SHA-512 output.  
### Parameters
Name | Description  
---|---  
The binary input value to hash.  
`algorithm` | The name of the algorithm to use for calculating the hash value of `content`. This value is a string. Defaults to `SHA-1`.  
### Example
This example uses the MD2 algorithm to encrypt a binary value.
#### Source
```
%dw 2.0
import dw::Crypto
output application/json
---
{ "md2" : Crypto::hashWith("hello" as Binary, "MD2") }
```

#### Output
```
{ "md2": "\ufffd\u0004ls\ufffd\u00031\ufffdh\ufffd}8\u0004\ufffd\u0006U" }
```
Sending Notifications to External Systems | MuleSoft Documentation
# Sending Notifications to External Systems
To help deliver Anypoint Monitoring notifications to external systems, Anypoint Monitoring provides links to connectors on Anypoint Exchange that you can incorporate into a Mule app.
Figure 1. Tools Available in Anypoint Monitoring
  1. Open Anypoint Monitoring.
  2. Click **Tools**.
  3. Review the connectors.
You can hover over a connector link to learn more before navigating to Anypoint Exchange.
Salesforce Composite Connector 2.12 | MuleSoft Documentation
# Salesforce Composite Connector 2.12
Anypoint Connector for Salesforce Composite enables you to work with the Salesforce Batch and SObject Tree APIs. The connector exposes convenient methods for preparing subordinate requests, executing them in one batch, and parsing the results.
Salesforce Composite Connector also enables you to create SObject trees by using the **Create sobject tree** operation, which is separate from the batch operations.
This connector provides DataSense for execution and to:
  * Prepare subordinate requests and then parse the responses
  * Create SObject trees


For compatibility information and fixed issues, see Salesforce Composite Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * The Salesforce Composite API
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements and global elements in a Mule flow
  * Creating a Mule app using Anypoint Studio (Studio)


Before creating an app, you must have:
  * Credentials to access the Salesforce Composite target resource
  * Anypoint Studio version 7.0 or later


## Authentication Types
Salesforce Composite Connector connections use the following authentication types:
  * OAuth v2.0
  * OAuth JWT
  * OAuth SAML
  * OAuth Username and Password
  * Token Connection


For information about configuring these authentication types, see Using Anypoint Studio to Configure Salesforce Composite Connector.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * MuleSoft Help Center
Downloading an Asset | MuleSoft Documentation
# Downloading an Asset
Download lets you download a copy of the asset, or in the case of a Custom asset, the optional file attached to the asset when it was created.
After creating a REST asset, Exchange generates a Mule 3 connector and a Mule 4 connector. Exchange also generates an OAS 2.0 version for RAML assets, and a RAML version for OAS 2.0 and OAS 3.0 assets. After you create a new REST asset it may take a few minutes for these assets to appear on the Download menu.
When you change the asset name, description, labels, or categories of the REST asset, Exchange updates these attributes for the generated connectors.
RAML versions have been automatically generated for all OAS assets published since January 12, 2019, and OAS 2.0 versions have been automatically generated for all RAML assets published since that date. If you find an older asset that does not include one of these versions, you can generate all versions by downloading the asset and uploading it again.
Click **Download** from the asset details pane.
The results vary by file type:
  * REST API RAML
If you choose As RAML, the original RAML file downloads as a zip file. If you choose As OAS, Exchange downloads the API specification as a zip file containing a JSON file for the specification in OAS 2.0 format. If you choose As Mule 4 connector, it downloads as a jar file you can add to a Studio 7 Mule project. If you choose As Mule 3 connector, it downloads as a zip file you can add to a Studio 6 Mule project.
  * REST API OAS
If you choose As RAML, Exchange downloads the API specification as a zip file containing a RAML file for the specification. If you choose As OAS, it downloads as a zip file containing a file in the original format of either JSON or YAML. If you choose As Mule 4 connector, it downloads as a jar file you can add to a Studio 7 Mule project. If you choose As Mule 3 connector, it downloads as a zip file you can add to a Studio 6 Mule project.
  * SOAP API WSDL
Downloads as a WSDL file.
  * Connector
Downloads as a jar file.
  * Template
Downloads as a jar or zip file.
  * Example
Downloads as a zip file.
  * Policy
If you choose **As Mule policy** , Exchange downloads the policy as a JAR file. If you choose **As Policy definition** , Exchange downloads the definition YAML file.
  * Custom with a file
Downloads the same format file that you uploaded, but the file name is based on your application name.
For example, if you upload a text file for the Inventory Distribution project, Exchange downloads `inventory-distribution.txt`.
  * Custom without a file
The **Download** button does not appear.
  * API Group
The **Download** button does not appear.
  * AsyncAPI
Downloads the API specification as a zip file containing a YAML file for the specification and a JSON file that contains the metadata of the asset.
Standalone Mule Support in MuleSoft Government Cloud | MuleSoft Documentation
# Standalone Mule Support in MuleSoft Government Cloud
MuleSoft Government Cloud deployment permits deployment of Mule runtime engine instances into an on-premises environment (standalone Mule instances). Standalone Mule instances, and MuleSoft support for standalone Mule instances, are outside the scope of FedRAMP. The customer is responsible for ensuring that all data shared with Salesforce complies with any and all data and information protection policies, requirements, and standards. Review the MuleSoft System Security Plan for FedRAMP scope.
Rigorous internal security and compliance reviews were performed on services that support standalone Mule deployments in MuleSoft Government Cloud. The Significant Change Request Form and updated System Security Plan were approved by our FedRAMP sponsoring agency.
For FIPS compliance, Mule Runtime version 4.1.x or later and runtime agent version 2.4.9 or later are required.
Standalone Mule support enables federal, state, and local government customers to deploy Mules inside their private cloud or on-premises environment and manage them using the MuleSoft Government Cloud control plane. Key features include:
  * Mule Management
    * Unified view of applications, servers, and APIs
    * Application deployment and management across all environments
    * Integration with continuous deployment pipelines
    * Anypoint Runtime Manager capabilities
  * Anypoint Runtime Manager monitoring
    * Dashboards for apps, servers, and server groups
    * Visibility into usage and performance metrics
    * Email alerts and notifications
    * Performance metrics for flows
    * Ability to Monitor Applications and Servers


## Mule Version Support
The following Mule versions are supported for standalone Mule support in MuleSoft Government Cloud:
  * 4.1.x
  * 4.2.x
  * 4.3.x
  * 4.6.x


To get started, refer to the Anypoint Runtime Manager documentation.
Numbers (dw::core::Numbers) | MuleSoft Documentation
# Numbers (dw::core::Numbers)
This module contains helper functions for working with numbers.
To use this module, you must import it to your DataWeave code, for example, by adding the line `import * from dw::core::Numbers` to the header of your DataWeave script.
_Introduced in DataWeave version 2.2.0._
## Functions
Name | Description  
---|---  
Transforms from a binary number into a decimal number.  
Transforms a hexadecimal number into decimal number.  
| Transforms a number in the specified radix into decimal number  
Transforms a decimal number into a binary number.  
Transforms a decimal number into a hexadecimal number.  
| Transforms a decimal number into a number string in other radix.
Testing an API Alert | MuleSoft Documentation
# Testing an API Alert
This procedure describes how to test a request count alert. This procedure requires the following preparation:
  1. Design an API.
  2. Publish the API to Exchange.
  3. In API Manager, manage the API from Exchange.
  4. Deploy a proxy of the API instance to CloudHub.
  5. Apply the Rate Limiting Policy to the API as follows: Request Count greater than 1 for at least 1 consecutive minute.
  6. Add the alert described in the topic about how to add an alert.
  7. Call the API.
  8. Recall the API two more times (reload the page). Check that `API calls exceeded` appears if you called and recalled the API within the 1 minute period. Any additional page reload operations within the 1 minute period have no effect.
  9. Check that users, who you selected for email notification when you added the alert, actually receive email notifications.
  10. Check that the alert was resolved.


## See Also
  * Adding an API Alert
  * Create and Publish an API Specification or API Fragment
Using the Execution Mode | MuleSoft Documentation
# Using the Execution Mode
Determine whether a script is automatically compiled or forced to be interpreted using the Scripting Module **Execution Mode** field.
Configure the field in these modes:
  * **AUTO** Uses the compiled version of the script if the compilation is possible and successful during the initialization. This mode doesn’t perform a dynamic analysis of the script’s content to determine whether it should switch to interpreted execution. For example, if the script contains hardcoded parameters or local values that need to be dynamic, the `AUTO` mode doesn’t detect this situation and can opt for compilation, resulting in the loss of these values.
Therefore, `AUTO` mode applies only if there are no critical dependencies on local variables that could be lost during compilation.
  * **INTERPRETED** Avoids issues related to variable retention.
Using `INTERPRETED` mode can lead to performance degradation because the script is interpreted with each execution instead of being compiled once. This mode only applies to scenarios where modifying the script to receive parameters explicitly is not feasible, as it is inherently less efficient.


This XML example shows the **Execution Mode** field (`executionMode`) configuration:
```
<mule ...>
	<flow name="conn-flow" >
		<scripting:execute
engine="jruby" executionMode="INTERPRETED">
        <scripting:code>
				...
</scripting:code>
        ...
      </scripting:execute>
	</flow>
</mule>
```

## See Also
  * Scripting Module - Examples
MuleSoft Automation Credits 1.0 | MuleSoft Documentation
# MuleSoft Automation Credits 1.0
Your MuleSoft Automation subscription plan includes a quota of Automation Credits that you can use with MuleSoft Composer, MuleSoft IDP, MuleSoft RPA, or a combination of these products. As you use processes to create automations, your total credit quota is depleted.
The following table shows the conversion rate between Automation Credits and different activities:
RPA Bot Minutes | RPA API Calls | Composer Tasks | IDP Document Pages  
---|---|---|---  
1 MuleSoft Automation Credit = 2 | 1 MuleSoft Automation Credit = 100 | 1 MuleSoft Automation Credit = 50 | 1 MuleSoft Automation Credit = 6  
You can use any combination of these activities, which aggregate over the term of your subscription (not per session), and are then converted to credits as shown. Then, the credits are deducted from your assigned quota for the subscription period.
For detailed definitions and more information, see the MuleSoft Product Subscription Plans.
## Usage Summary
The **Usage Summary** page enables you to view your monthly tasks and credit usage per flow for your organization. All Composer users in your organization have access to this page. The monthly summary usage report is usually available five business days after the month close. Reports are available starting from September 2022.
## See Also
  * Mulesoft Composer: Overview
  * MuleSoft Composer: Getting Started
  * Composer Connector Reference
  * Knowledge Articles
  * Automation Credits Usage and Rates
Apache Kafka Connector 4.5 | MuleSoft Documentation
# Apache Kafka Connector 4.5
Anypoint Connector for Apache Kafka (Apache Kafka Connector) enables you to interact with the Apache Kafka messaging system and achieve seamless integration between your Mule app and a Kafka cluster, using Mule runtime engine (Mule).
For compatibility information see the Apache Kafka Connector Release Notes.
## Before You Begin
Before creating an app, you must:
  * Have access to the Apache Kafka target resource and Anypoint Platform
  * Understand how to create a Mule app using Anypoint Studio
  * Have access to Apache Kafka to get values for the fields that appear in Studio


## Use Cases
Apache Kafka is a multipurpose application. Integration with Apache Kafka relies on the applications that are typically used with it.
Example use cases include:
  * An integration application that ensures that patients in a hospital receive the care they need in a timely manner An example of this is a hospital server that processes emergency requests for patient admissions. The requests are ordered by priority determined by specified criteria, such as how critical the patient’s condition is and the staff that is available to treat the patient. In this scenario, an application processes Apache Kafka messages in the order that they are received, relying on the order and idempotency of the messages sent through the queue.
  * An application that is time-sensitive An example is a newsroom that uses the Apache Kafka system to deliver the latest news. To retrieve the latest news, reading from the Apache Kafka queue sometimes requires reading from the end of the queue first.
  * Multiple applications that rely on the information provided by Apache Kafka For example, a department store uses a website activity tracker to improve the online shopping experience. The data that is gathered is sent to multiple departments for various computations. Each department reviews the information that’s received to stay informed about what the customer is looking for and then provides recommendations accordingly.


## Audience
  * Starting user
To create a Mule app, see Apache Kafka Studio Configuration.
  * Power user
Read XML and Maven Support and Examples.


## Next
After you complete the prerequisites, you are ready to create an app with Anypoint Studio.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  *   * MuleSoft Help Center
Creating Monitors That Use a Specific Location | MuleSoft Documentation
# Creating Monitors That Use a Specific Location
To create a monitor that uses a specific location:
  1. Run the following command to list the locations that are in your default profile:
```
bat location ls
```

To use a non-default profile, add `--profile=<name-of-profile>` to the commands in these steps.  
---  
  2. Find the entry for the location that you want to use.
For public locations, the value of the `organizationId` field is `public`. For private locations, the value is your organization ID.
Here is example output from this command:
```
organizationId: 612dbc11-a043-4b8b-b76e-7d51f84723c7
targets:
-
 id: 75c403a6-8054-43ec-b611-63b9efff820d
 name: us-east-1
 transport: LAMBDA
 organizationId: public
-
 id: 799baaeb-3c86-4798-b5b4-6d6954254229
 name: us-east-2
 transport: LAMBDA
 organizationId: public
-
 id: b4b4db50-bcbb-4b9a-93e1-50259fd100f7
 name: myLocation
 transport: MULE
 organizationId: 612dbc11-a043-4b8b-b76e-7d51f84723c7
```

  3. Copy to your clipboard the value of the `id` field for the location that you want to use.
For example, to use the private location in the example output, copy the value of the `id` field for the third location listed.
  4. Create the schedule, using the `--target` parameter and pasting in the value of the `id` field, as in this example:
```
bat schedule create --target=b4b4db50-bcbb-4b9a-93e1-50259fd100f7
```

This schedule uses the default interval of 15 minutes.  
---  
The output of the `bat schedule create` command looks like this:
```
#Creating artifact...
 + exchange.json
 + .DS_Store
 + config/default.dwl
 + config/qax.dwl
 + config/devx.dwl
 + config/stgx.dwl
 + tests/HelloWorld.dwl
 + bat.yaml
# Creating artifact...OK
# Uploading 612dbc11-a043-4b8b-b76e-7d51f84723c7:HelloWorldSuite:0.0.1
# Version 0.0.1 published
scheduleId: 345305b4-0244-4a75-a304-220495e2e34a
```

  5. If you run the `bat schedule ls` command, you see an entry like this one:


```
# HelloWorldSuite
# every 15 minutes
id: 345305b4-0244-4a75-a304-220495e2e34a
test: 612dbc11-a043-4b8b-b76e-7d51f84723c7:HelloWorldSuite
version: 0.0.1
organizationId: 612dbc11-a043-4b8b-b76e-7d51f84723c7
config: default
target:
 id: b4b4db50-bcbb-4b9a-93e1-50259fd100f7
 name: myLocation
 transport: MULE
nextExecution: 2019-09-27T02:15:00Z
cron: 0 */15 * * * ? *
active: true
```
Anypoint Exchange Release Notes | MuleSoft Documentation
# Anypoint Exchange Release Notes
Anypoint Exchange provides a user interface consisting of asset cards that you can filter and click to provide information on connectors, APIs, examples, templates, and custom assets.
The following release notes are provided for Exchange:
  *   * Exchange 2 REST Connect Release Notes


See Also: Anypoint Exchange Overview
Handling Message Acknowledgement | MuleSoft Documentation
# Handling Message Acknowledgement
There are different acknowledgement configurations provided by the JMS connector.
## Automatic Acknowledgement On Success
The `AUTO ackMode` can be used in the `ibm-mq:listener` component, causing the automatic ACK of the received message **if and only if** the flow execution completes successfully. If an error occurs during the flow execution that causes it to terminate prematurely, then the message is not acknowledged and redelivery occurs.
Another `ackMode` similar to `AUTO` is `DUPS_OK`. With `DUPS_OK` the message is acknowledged automatically upon the success of the flow execution but in a lazy fashion which may lead to duplicates since the message may be redelivered before the ACK is performed.
## Immediate Acknowledgement
Setting the `ackMode` to `IMMEDIATE` either in `ibm-mq:listener` or `ibm-mq:consume` operations causes the message to be automatically acknowledged once it is consumed, and prior to any processing of the message by the application. Having the message automatically acknowledged after it is received means that the message won’t be redelivered if any error occurs during the processing of the message, so application logic like a dead letter queue has to be created to handle errors without losing messages.
## Manual Acknowledgement
As you may expect, the `MANUAL` `ackMode` delegates all the responsibility of performing the ACK on the message to the application logic.
With this configuration, every message received by either the `listener` or `consume` operations has an `ackId` available in the Mule Message `attributes` which identifies this message uniquely for a given connection.
The `ackId` that identifies the message passes to the `ibm-mq:ack` operation:
```
<flow name="consumerWithManualAck">
  <ibm-mq:consume config-ref="JMS_config" destination="openTickets" ackMode="MANUAL"/>
  <!--Do message processing-->
  <logger message="#[payload]">
  <ibm-mq:ack ackId="#[attributes.ackId]"/>
</flow>
```

### Manual Session Recovery
When using the `MANUAL ackMode`, all messages that are received but not acknowledged won’t be redelivered by the broker. If an error occurs during the message processing that prevents it from being acknowledged, the user is responsible for manually recovering all the messages in the session that have to be redelivered using the `recover-session` operation:
```
<flow name="consumerWithManualAck">
  <ibm-mq:consume config-ref="JMS_config" destination="${destination}"
         ackMode="MANUAL" target="consumedMessage" targetValue="#[message]"/>
  <!--Do message processing-->
  <logger message="#[payload]">
  <ibm-mq:ack ackId="#[vars.consumedMessage.attributes.ackId]"/>
  <error-handler>
    <on-error-propagate>
      <!--In case of error, recover the session-->
      <ibm-mq:recover-session ackId="#[vars.consumedMessage.attributes.ackId]"/>
    </on-error-continue>
  </error-handler>
</flow>
```

Same as before, the connection used for recovering the session has to be the same as the one used for receiving the message.
## See Also
  * Using Topic Subscriptions
  * How To Listen For New Messages
mapLeafValues | MuleSoft Documentation
# mapLeafValues
## mapLeafValues(value: Any, callback: (value: Any, path: Path) -> Any): Any
Maps the terminal (leaf) nodes in the tree.
Leafs nodes cannot have an object or an array as a value.
_Introduced in DataWeave version 2.2.2._
### Parameters
Name | Description  
---|---  
The value to map.  
The mapper function.  
### Example
This example transforms all the string values to upper case.
#### Source
```
%dw 2.0
import * from dw::util::Tree
output application/json
---
 {
   user: [{
     name: "mariano",
     lastName: "achaval"
   }],
   group: "data-weave"
 } mapLeafValues (value, path) -> upper(value)
```

#### Output
```
{
  "user": [
   {
    "name": "MARIANO",
    "lastName": "ACHAVAL"
   }
  ],
  "group": "DATA-WEAVE"
 }
```

### Example
This example returns a new value for an object, array, or attribute.
#### Source
```
%dw 2.0
output application/json
import * from dw::util::Tree
---
{
  name: "Mariano",
  test: [1,2,3]
} mapLeafValues ((value, path) -> if(isObjectType(path))
                    "***"
                 else if(isArrayType(path))
                    "In an array"
                 else "Is an attribute")
```

#### Output
```
{
 "name": "***",
 "test": [
  "In an array",
  "In an array",
  "In an array"
 ]
}
```
Managing Flex Gateway | MuleSoft Documentation
# Managing Flex Gateway
Refer to the following tasks for details about gateway management:
  * Upgrade Flex Gateway
  * Delete an Instance of Flex Gateway
  * Uninstall Flex Gateway
  * Manage Kubernetes Deployments
  * Renew Flex Gateway Registration


## See Also
  * Flex Gateway Overview
  * Getting Started with Flex Gateway
fail | MuleSoft Documentation
# fail
## fail(message: String = 'Error'): Nothing
Throws an exception with the specified message.
### Parameters
Name | Description  
---|---  
An error message (`String`).  
### Example
This example returns a failure message `Data was empty` because the expression `(sizeOf(myVar) <= 0)` is `true`. A shortened version of the error message is shown in the output.
#### Source
```
%dw 2.0
import * from dw::Runtime
var result = []
output application/json
---
if(sizeOf(result) <= 0) fail('Data was empty') else result
```

#### Output
```
ERROR 2018-07-29 11:47:44,983 ...
*********************************
Message        : "Data was empty
...
```
AMQP Connector Examples | MuleSoft Documentation
# AMQP Connector Examples
To fully benefit from using Anypoint Connector for AMQP (AMQP Connector), see the following examples of configuring the connector operations:
  * Manage Message Acknowledgments Configure AMQP Connector to manage different acknowledgment configurations, such as automatic acknowledgment on success, immediate acknowledgment, and manual acknowledgment.
  * Listen for New Messages Configure the Listener source to listen for new messages as they arrive into an AMQP queue.
  * Publish New Messages Configure the Publish operation to create a new AMQP message and send it to the specified exchange.
  * Consume Messages Configure the Consume operation to consume a message at any given time in the flow, from any given AMQP queue.
  * Publish Messages and Listen for Replies Configure the Publish Consume operation to publish a message to any exchange, and then wait for a reply on a different destination.
  * Manage Transactions Configure AMQP Connector to manage transactional connections to execute a series of operations.
  * Avoid Changing the AMQP Topography Configure AMQP Connector global config properties so that the declaration of AMQP exchanges and queues is disabled.
  * Connect to mTLS Configure AMQP Connector to connect to an AMQP broker with mutual TLS (mTLS) authentication.


## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
Servers | MuleSoft Documentation
# Servers
Private Cloud Edition 
Anypoint Runtime Manager provides an interface you use to manage your on-premises Mule runtime engine instances (servers). You can manage servers either individually or in server groups or clusters.
Servers communicate with Runtime Manager using Runtime Manager agent. After adding a server, use Runtime Manager to deploy applications to the Mule instance. You can also view information about the environment where you installed Mule.
For each Mule instance that you want to manage, add a server to Runtime Manager. In environments with multiple Mule instances, use server groups and clusters for redundancy, high availability, and ease of management.
## See Also
  * Add Servers to Runtime Manager
  *
Testing APIs Using an API Instance | MuleSoft Documentation
# Testing APIs Using an API Instance
The API Console enables you to test an API using an API instance as a server. API instances let you interact with a server by sending requests and getting responses with actual data.
## Before You Begin
You must have an API specification with at least one endpoint and one method in it.
## Test an API Using an Instance
  1. On the **Home** or the **APIs** page, select a REST API.
  2. Select the **API specification** tab.
  3. In the **Specification** pane, click a method like `get`.
  4. In the **Try it** pane, select an instance URL from the **Select Server** options.
  5. Enter any query parameters you want to test.
  6. Click **Send** to send data to the API.
  7. Verify the returned responses from the API.
Avro Format | MuleSoft Documentation
# Avro Format
MIME type: `application/avro`
ID: `avro`
Avro is a binary data format that uses a schema to structure its data. DataWeave relies on the schema to parse the data. Avro data structures are mapped to DataWeave data structures.
## Java Value Mapping
The following table shows how Avro types map to DataWeave types.
Avro Type | DataWeave Type  
---|---  
## Example: Use an Avro Schema
The following example shows how to specify a schema that the writer uses to output an Avro data structure.
### Input
An Avro schema looks something like this.
schema.json:
```
{
  "type": "record",
  "name": "userInfo",
  "namespace": "my.example",
  "fields": [
    {
      "name": "username",
      "type": "string",
      "default": "NONE"
    },
    {
      "name": "age",
      "type": "int",
      "default": -1
    },
    {
      "name": "phone",
      "type": "string",
      "default": "NONE"
    },
    {
      "name": "housenum",
      "type": "string",
      "default": "NONE"
    }
  ]
}
```

### Source
The `schemaUrl` property in the header of this DataWeave script passes a schema (`schema.json`) to the DataWeave writer. The writer uses the schema to structure content from the body of the script and output the results in Avro format.
```
%dw 2.0
output application/avro schemaUrl="classpath://schema.json"
---
[{
  username: "Mariano",
  age: 35,
  phone: "213",
  housenum: "123"
},
{
  username: "Leandro",
  age: 29,
  phone: "213",
  housenum: "123"
},
{
  username: "Christian",
  age: 25,
  phone: "213",
  housenum: "123"
}]
```

## Configuration Properties
DataWeave supports the following configuration properties for this format.
### Reader Properties
This format accepts properties that provide instructions for reading input data.
Parameter | Type | Default | Description  
---|---|---|---  
`schemaUrl` (Required) |  The URL for the Avro schema. Valid URL schemes are `classpath://`, `file://`, or `http://`. For the reader, this property is optional but defaults to the schema embedded in the input Avro file. The reader requires an embedded schema. For the writer, DataWeave requires a schema value.  
### Writer Properties
This format accepts properties that provide instructions for writing output data.
Parameter | Type | Default | Description  
---|---|---|---  
`bufferSize` |  Size of the buffer writer, in bytes. The value must be greater than `8`.  
Generates the output as a data stream when set to `true`, and defers the script’s execution until the generated content is consumed. Valid values are `true` or `false`.  
`schemaUrl` (Required) |  The URL for the Avro schema. Valid URL schemes are `classpath://`, `file://`, or `http://`. For the reader, this property is optional but defaults to the schema embedded in the input Avro file. The reader requires an embedded schema. For the writer, DataWeave requires a schema value.  
## Supported MIME Types
This format supports the following MIME types.
`application/avro`  
---
evaluateCompatibilityFlag | MuleSoft Documentation
# evaluateCompatibilityFlag
## evaluateCompatibilityFlag(flag: String): Boolean
Returns the value of the compatibility flag with the specified name.
_Introduced in DataWeave version 2.5.0._
### Parameters
Name | Type | Description  
---|---|---  
The name of the compatibility flag to evaluate.  
### Example
This example gets the `com.mulesoft.dw.xml_reader.honourMixedContentStructure` compatibility flag value in the current DataWeave version.
#### Source
```
%dw 2.0
output application/json
---
{
 "com.mulesoft.dw.xml_reader.honourMixedContentStructure": evaluateCompatibilityFlag("com.mulesoft.dw.xml_reader.honourMixedContentStructure")
}
```

#### Output
```
{
 "com.mulesoft.dw.xml_reader.honourMixedContentStructure": true
}
```
HTTP Basic Authentication Policy | MuleSoft Documentation
# HTTP Basic Authentication Policy
This page describes the configuration and runtime application instructions for the HTTP Basic Authentication policy. This policy verifies request credentials and enforces access according to your configuration.
This policy requires a Security Manager policy in order to function. You can use the Simple Security Manager policy for testing, or to configure an LDAP Security Manager. See the LDAP Security Manager policy documentation for how to configure a security manager against which the HTTP Basic Auth policy can authenticate.
No configuration is required.
## Obtaining User Credentials
To access information about users are using your API, place the following script in any place between your proxy’s inbound and outbound endpoints. The script executes after the HTTP Basic Authentication Policy:
```
<expression-component>
  message.outboundProperties.put('X-Authenticated-userid', _muleEvent.session.securityContext.authentication.principal.username)
</expression-component>
```

The script stores the username in the mule message as an outbound-property named `X-Authenticated-userid`. The HTTP connector, which generates the proxy’s output, transforms any outbound properties that reach the connector into HTTP message headers. The message that reaches your API after passing through your proxy includes an HTTP header named `X-Authenticated-userid`, containing the username.
You can modify this code to change the name of the header being created.
## See Also
  * LDAP Security Manager