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
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Mastering Multi-Cloud Integration: SAFe 5.0, MuleSoft, and AWS - A Personal Journey
  • Revolutionize Your MuleSoft Deployments With GitOps
  • MuleSoft Integrate With ServiceNow
  • Migrating MuleSoft System API to AWS Lambda (Part 1)

Trending

  • MQTT, Kafka, NATS, or Zenoh? Choosing Edge-to-Cloud Messaging by Traffic Pattern
  • Threat Modeling Context-Aware AI: A STRIDE Walkthrough
  • Building Enterprise File-Heavy AI Workflows: From Secure Uploads to Governed Document Intelligence
  • SSRF Prevention in C#: Securing File Imports From User-Supplied URLs

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Migrating AnypointMQ-Based Mulesoft Service to Serverless World

Migrating AnypointMQ-Based Mulesoft Service to Serverless World

In this article, we demonstrate how we migrated MuleSoft-based integration services interconnected via AnypointMQ into a completely serverless architecture.

By 
Pranav K
DZone Core CORE ·
Dec. 19, 23 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
3.8K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

In this article, we demonstrate how we migrated MuleSoft-based integration services that are interconnected via AnypointMQ-based messaging queue infrastructure into a completely serverless architecture. Let's start by looking at the existing integration architecture running on the MuleSoft platform.

Current Architecture

In our exercise, we have two MuleSoft services involved. The first service acts as a producer, and the second service acts as a consumer. The producer service accepts messages from mobile, web, and other internal enterprise services via a REST endpoint, and it places the payload into the AnypointMQ queue. The message is delivered to the queue after being transformed into a standard format (canonical) for use by all consumers in the enterprise. Additionally, the message undergoes a few standard validations before it is transformed.

The second service is a consumer service that retrieves the message from the AnypointMQ queue. The message is then transformed from the canonical format to CSV or pipe-separated values and routed to the appropriate FTP folders.
Current architecture

Current architecture

Serverless Architecture

When transitioning to a serverless architecture, it is essential to carefully choose the appropriate systems and components to replace the existing ones. In our case, we are substituting MuleSoft with AWS Lambda, AnypointMQ with Amazon SQS, and Anypoint Designer with Kumologica.

In this architecture, AWS Lambda will serve as the hosting platform, providing a perfect serverless compute unit for our services. Amazon SQS will seamlessly take the place of AnypointMQ, ensuring there is no impact on the message delivery mechanism while leveraging the benefits of a serverless messaging infrastructure. Exposing APIs to the outside world will be accomplished through AWS API Gateway.

For development purposes, Kumologica Designer, a low-code development tool similar to MuleSoft, will be employed. This tool simplifies the migration of Mule flows to Kumologica flows, ensuring a smooth transition and ease of development for our services.

Serverless design

Serverless design

Building the Service

We will be using Kumologica Designer to build the services. Kumologica flows are based on NodeJS; hence, we need to have NodeJS installed on our machine. First, we will be building the producer service, which drops the message into the queue.

Producer Service

Producer service in MuleSoft is exposed using APIKit router and is an HTTP-based endpoint that accepts the request payload in JSON format. The accepted JSON format is transformed to CSV format or tab-separated format using Dataweave. Based on one of the attributes in the payload, the choice router in the flow will decide which FTP connector it needs to send the final file. Now, let's see how we replaced this MuleSoft flow with Kumologica nodes.

MuleSoft flow with Kumologica nodes

Note: Dataweave processors in MuleSoft use dataweave expression, whereas Datamapper uses JSONata expression. JSONata expressions are very similar to dataweave with few differences in syntax and functions. Both of them follow function chaining.

The Kumologica flow will look as shown below:

Producer Service flow

Producer Service flow

Consumer Service

In consumer service, Anypoint Listener picks the message from Anypoint MQ. Based on the target field attribute in the message using the choice router, the flow decides whether to transform as CSV payload or tab-separated payload. The message is transformed using Dataweave. The transformed message is then passed to the FTP connector. Now, let's see how we replaced this MuleSoft flow with Kumologica nodes.

The Kumologica flow will look as shown below:  

Consumer Service flow

Consumer Service flow


MuleSoft Integration

Opinions expressed by DZone contributors are their own.

Related

  • Mastering Multi-Cloud Integration: SAFe 5.0, MuleSoft, and AWS - A Personal Journey
  • Revolutionize Your MuleSoft Deployments With GitOps
  • MuleSoft Integrate With ServiceNow
  • Migrating MuleSoft System API to AWS Lambda (Part 1)

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • 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