DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Create Proxy Application for Mule APIs
  • Create Custom DataWeave Functions in Mule 4
  • MuleSoft: Do You Have an Extra Mule Under the Hood?
  • MuleSoft: Tactical and Strategical Role of an Application Template

Trending

  • Self-Hosted Inference Doesn’t Have to Be a Nightmare: How to Use GPUStack
  • What Nobody Tells You About Multimodal Data Pipelines for AI Training
  • Scaling Cloud Data Automation: A Practical Guide to Open Table Formats
  • Zone-Free Angular: Unlocking High-Performance Change Detection With Signals and Modern Reactivity
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. API-Led Connectivity and Discovery in MuleSoft Runtime Fabric

API-Led Connectivity and Discovery in MuleSoft Runtime Fabric

API-Let connectivity is one of the crucial approaches to segregate integrations and processing stages in API based platform.

By 
Sadik Ali user avatar
Sadik Ali
·
Oct. 26, 20 · Analysis
Likes (5)
Comment
Save
Tweet
Share
6.1K Views

Join the DZone community and get the full member experience.

Join For Free

 API-Let connectivity in MuleSoft Runtime Fabric.

controller

API-Let connectivity is one of the crucial approaches to segregate integrations and processing stages in API based platform.

Points to understand: 

In Runtime Fabric, a DNS record is created for each application deployed in the cluster in the internal "cluster.local" domain.

Example: meetup-xapi-app.e2aaff45-2f2e-4aaa-9332-xxxxxxxxxx.svc.cluster.local"

Where "meetup-xapi-app" is the application name and "e2aaff45-2f2e-4aaa-9332-xxxxxxxxxx" is the namespace name (environment ID).

               Every pod in Runtime Fabric, it looks for domains configured. 

To looks for the DNS query, it searches in each domain until getting a none NXDomain response. Furthermore, to communicate between MuleSoft applications deployed in the same namespace (Under Same Controller instance), an application name can be used to access applications. 

Implementation details as below:

Step 1

API: Experience API (meetup-xapi

API: System API (meetup-sapi)

design center

Step 2: Publish it to Exchange

XExchange

Step 3: Import This Above Apis in-Studio and Enhance Flow So XAPI Can Send Request To SAPI

 XAPI's flow configuration: 

XAPI

 2.  SAPI's flow configuration:         SAPI

 3. Publish to exchange in Anypoint platform using below maven command as below 

  • Publish in Exchange: mvn clean package deploy
  • Deploy in RTF: mvn deploy -DmuleDeploy
XML
 




xxxxxxxxxx
1
39


 
1
<build>
2
        <plugins>
3
            <plugin>
4
                <groupId>org.apache.maven.plugins</groupId>
5
                <artifactId>maven-clean-plugin</artifactId>
6
                <version>3.0.0</version>
7
            </plugin>
8
            <plugin>
9
                <groupId>org.mule.tools.maven</groupId>
10
                <artifactId>mule-maven-plugin</artifactId>
11
                <version>3.3.5</version>
12
                <extensions>true</extensions>
13
                <configuration>
14
                    <runtimeFabricDeployment>
15
                        <uri>https://anypoint.mulesoft.com</uri>
16
                        <muleVersion>${app.runtime}</muleVersion>
17
                        <username>${anypoint.login.id}</username>
18
                        <password>${anypoint.login.password}</password>
19
                        <applicationName>meetup-sapi-app</applicationName>
20
                        <server><sessting.server.id></server>
21
                        <target><runtime-fabric-setupname></target>
22
                        <environment><associated.environment></environment>
23
                        <deploymentTimeout>900000</deploymentTimeout>
24
                        <provider>MC</provider>
25
                        <properties>
26
                            <key>value</key>
27
                        </properties>
28
                        <deploymentSettings>
29
                            <replicationFactor>1</replicationFactor>
30
                            <publicUrl>helloworld.kelltontech.com/meetup-sapi-app</publicUrl>
31
                            <cpuReserved>500m</cpuReserved>
32
                            <memoryReserved>800Mi</memoryReserved>
33
                        </deploymentSettings>
34
                    </runtimeFabricDeployment>
35
                    <classifier>mule-application</classifier>
36
                </configuration>
37
            </plugin>
38
        </plugins>
39
    </build>


   

4: Configure environment variables for applications.

  • Go to location: /opt/anypoint/runtimefabric                   
Plain Text
 




xxxxxxxxxx
1


 
1
./rtfctl apply secure-property --key system.host.ip --value meetup-sapi-app -n e2aaff45-2f2e-4aaa-9332-f7b7e42aa644
2
./rtfctl apply secure-property --key system.host.port --value 8081 -n e2aaff45-2f2e-4aaa-9332-f7b7e42aa644
3
./rtfctl apply secure-property --key system.host.app --value xapi -n e2aaff45-2f2e-4aaa-9332-f7b7e42aa644
4
./rtfctl apply secure-property --key system.host.app --value api/xapi -n e2aaff45-2f2e-4aaa-9332-f7b7e42aa644


 

  • Validate below system-level configuration:system-level config

5: Deploy the application in Runtime Fabric from the exchange:

runtime manager

Now test application to validate request able to reach from XAPI to SAPI.

hello world

How does it communicate?

  • Enter in gravity and find XAPI application POD ID in which it has been deployed and environment  id of it.

application POD

[Command: kubectl exec -it meetup-xapi-app-74b84966d6-4dqtxs --namespace=e2aaff45-2f2e-4aaa-9332-f7b7e42aa644 --container=app -- bash] 

  • Now find below command to send requests from XAPI's to SAPI POD. 

send requests

[Command: - curl --location --request GET 'http://meetup-sapi-app:8081/api/xapi' --header 'client_id: 6abd34350a0248a8b9e8d6c566070f06'  --header 'client_secret: 279cB8950f334bAc827C2311009fBB65']

application MuleSoft Discovery (law)

Opinions expressed by DZone contributors are their own.

Related

  • Create Proxy Application for Mule APIs
  • Create Custom DataWeave Functions in Mule 4
  • MuleSoft: Do You Have an Extra Mule Under the Hood?
  • MuleSoft: Tactical and Strategical Role of an Application Template

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook