ProstDev ProstDev
Tutorials Feb 13, 2024 · 5 min read

Part 2: Data Cloud + MuleSoft integration - Deploy your own Mule app on Anypoint Platform (CloudHub)

In this second part, we'll go through the MuleSoft side of the integration and you'll deploy your own Mule app to CloudHub.

By Alex Martinez
Thumbnail: Part 2: Data Cloud + MuleSoft integration - Deploy your own Mule app on Anypoint Platform (CloudHub) Read & copy the full video transcript

A little bird told me that deleting records in Data Cloud is actually not that easy to do. So, I did my research and came up with a Mule application for you all to reuse to (hopefully) make your lives easier when dealing with Data Cloud!

In this second part, we’ll go through the MuleSoft side of the integration and you’ll deploy your own Mule app to CloudHub. You do not have to know MuleSoft beforehand. I will guide you through every step.

Prerequisites

  • Anypoint Platform - You should have an Anypoint Platform account. You can create a new free trial account here. It will expire in 30 days but you can create a new one using the same details to register, just making sure to change the username to a different one.
  • Mule app’s JAR - You will need to download the Mule application in a JAR format. You can find the releases for this Mule project here. By the time this post was created, the latest release was v1.0.0. However, if there is new functionality added later, it might be better for you to use the latest version.
  • Salesforce credentials - Make sure you followed the previous post because you will need some of those credentials to follow this post. You will need:
    • salesforce.username - The username you use to log in to Salesforce
    • salesforce.password - The password you use to log in to Salesforce
    • cdp.consumer.key - The Consumer Key for the Connected App you created in Salesforce
    • cdp.consumer.secret - The Consumer Secret for the Connected App you created in Salesforce

Deploy application

Sign in to your Anypoint Platform account and navigate to Runtime Manager from the left-hand side menu.

Anypoint Platform header with the hamburger Products menu button

Anypoint Platform products menu with Runtime Manager highlighted

If this is your first time opening Runtime Manager, you will be asked to choose an environment. Choose Sandbox. Once inside, click on the blue Deploy application button.

Empty Runtime Manager Applications view in the Sandbox with a Deploy application button

Add any application name—for example, data-cloud-integration.

CloudHub 2.0 should be selected by default under Deployment Target, if not, please select it.

Under Application File, select Choose file > Upload File and select the JAR file you downloaded from the Prerequisites.

Deploy Application form with app name, CloudHub 2.0 target and the uploaded JAR file

Note

We will deploy to CloudHub 2.0, but if you’re deploying to CloudHub 1.0, the application name has to be unique across all applications worldwide. If the application name is not available, you can add your username at the end to make it unique. For example: data-cloud-integration-amartinez.

Runtime tab

Under the Runtime tab (which should be already open), make sure the Release Channel is set to None so we can select the Runtime Version 4.4.0.

You can experiment with different runtimes if you want! However, when this app was created and this post was published, I used version 4.4.0. I’ll document in future versions of the JAR file if a new runtime is supported.

Note

If you use the JAR version 2.1.0 or newer, you can select the runtime 4.7.0 and/or Java 11/17.

You can leave the rest of the settings with the default values.

Runtime tab with Release Channel set to None and Runtime Version 4.4.0

Properties tab

Now go to the Properties tab. Click on the Text view switch so you can copy and paste the following properties (add your actual credentials for each property):

salesforce.username=your_username
salesforce.password=your_password
cdp.consumer.key=your_key
cdp.consumer.secret=your_secret
anypoint.platform.gatekeeper=disabled

Note

The last property, anypoint.platform.gatekeeper has to be added for the JAR version 2.0.0 and newer. You can skip it if you’re using the 1.0.0 version.

Properties tab Text view with the Salesforce and Data Cloud credentials pasted in

Switch back to the Table view and click on the Protect button next to each of the values (this button is only available for CloudHub 2.0).

Properties tab Table view with a Protect button next to each property value

Now your credentials are not visible for added security. After this, click on Deploy Application. There is no need to modify the Ingress or Logging tabs.

Properties table showing each credential value as a protected value

Copy the URL

Wait a few seconds for the JAR file to be uploaded. After this, you might see your app has a 🔴 red circle. Don’t worry about this. If you go to the Settings tab you will see the yellow circle saying the configuration is still being applied. Wait a few more minutes until it’s deployed 🟢 (green circle). It can take up to 10 minutes.

App Settings showing data-cloud-integration applying configuration with status Not running

Once the app has been deployed and the Application Status says 🟢 Running, you can retrieve the public endpoint/URL from either the Settings or the Dashboard tab.

App Settings with status Running and the public endpoint CloudHub URL shown

Copy this URL. We will use it in the next article to call the integration.

Caution

DO NOT share this URL publicly. Anyone with this URL will be able to access your Data Cloud API (my URL from the previous screenshot is no longer available).

If you wish to create a new URL, you will have to delete this app from the Settings tab (where it says Stop at the top-right) and deploy a new one with a new name following the same steps.

You can Stop and Start your app only when you are using it to avoid unwanted requests.

Conclusion

After you follow all these steps, you should now have the public endpoint/URL that we will use to call our Mule application. The Mule app will then connect with Data Cloud using the credentials we provided in the settings.

Subscribe to receive notifications as soon as new content is published ✨

💬 Prost! 🍻

FAQs

Frequently asked questions about this post.

  • Do I need to know MuleSoft to follow this tutorial?

    No. You do not have to know MuleSoft beforehand because the post guides you through every step, from deploying the Mule application to CloudHub to copying the public endpoint URL.

  • What do I need before deploying the Mule app to CloudHub?

    You need an Anypoint Platform account (a free 30-day trial works), the Mule app's JAR file downloaded from https://github.com/alexandramartinez/datacloud-mulesoft-integration/releases , and the Salesforce credentials from Part 1: salesforce.username, salesforce.password, cdp.consumer.key, and cdp.consumer.secret.

  • Which runtime version should I select when deploying?

    Set the Release Channel to None so you can select Runtime Version 4.4.0, which is the version used when the app was created and this post was published; if you use the JAR version 2.1.0 or newer you can instead select runtime 4.7.0 and/or Java 11/17.

  • How do I protect my Salesforce credentials in the Properties tab?

    Paste the properties in the Text view, then switch back to the Table view and click the Protect button next to each value so the credentials are no longer visible; this Protect button is only available for CloudHub 2.0.

  • Why shouldn't I share the public endpoint URL?

    Anyone with that URL can access your Data Cloud API, so you should not share it publicly; if it is exposed you have to delete the app from the Settings tab and deploy a new one with a new name, and you can Stop and Start the app so it only runs while you are using it.

  • What is the `anypoint.platform.gatekeeper` property for?

    It is a property set to disabled that has to be added for JAR version 2.0.0 and newer; you can skip it if you are using the 1.0.0 version.

More from this series

Data Cloud + MuleSoft Integration· Part 2 of 5
  1. 1.Part 1: Data Cloud + MuleSoft integration - Connected App, Ingestion API & Data Stream settings in Salesforce
  2. 2.Part 2: Data Cloud + MuleSoft integration - Deploy your own Mule app on Anypoint Platform (CloudHub)
  3. 3.Part 3: Data Cloud + MuleSoft integration - Call your integration with Postman
  4. 4.Part 4: Data Cloud + MuleSoft integration - Secure your API with basic authentication in API Manager
  5. 5.Part 5: Data Cloud + MuleSoft integration - Insert data with the BULK operations
Search

Loading search…