Virtual Machine transport in Mulesoft

Posted by: Jerrod Hilpert at 06/06/2023 2,656 views

For intra-JVM interaction amongst Mule flows, the JVM transport can be used. By default, this transport employs in-memory queues, however, persistent queues can be set up as well. This article is intended to provide you with brief knowledge on VM Transport information,  various syntaxes and namespaces which will be used, transport consideration and features, usage, declaration of VM Namespaces, the configuration of endpoints, using transactions, and VQ queue in inbound transactions. Get this online Mulesoft training course designed by experienced professionals that aids you in mastering the mule platform operations which helps you to get along with the needs of your organization.

coupons up to 11

Information on VM Transport

VM Transport consists of the following list of information.

Transport: The transport protocol or name is listed.

Doc (SchemaDOC, JavaDOC): These are links to SchemaDoc and JavaDoc for transport.

Inbound: The transport's ability to receive the events of inbound and use them as an incoming endpoint.

Outbound: Is the transport capable of producing events of outbound and using an endpoint that is outbound?

Request: Is it possible to query this endpoint directly using a call request?

Transactions (XA): If the transport supports transactions. Commitment in two phases that are distributed (XA) or local transactions could be configured on transports that support transactions.

Streaming: Whether or not this transport could handle messages received via an input stream. It allows massive amounts of data to be processed quickly.

Retries: Whether or not this method of transportation supports the policy of retry. Any transport can have retry rules, but MuleSoft officially supports only those things noted here.

MEPs (request-response, one-way): Patterns of Message Exchange that this transport supports.

Default MEP: This transport is used by endpoints but doesn’t explicitly configure an MEP, this is the MEP by default.

Maven Artifact: In Maven, the group gives this transport an artifact name. 

coupons up to 41

Syntax and Namespace 

The following is the list of namespaces and syntaxes in VM transport.

Namespace in XML

Schema for VM

coupons up to 32

Location of the XML Schema

coupons up to 63

Syntax of Connectors

Persistent queues in a VM:

coupons up to 22

In-memory queues in a VM:

coupons up to 55

Syntax of Endpoints

The endpoint that is prefixed:

coupons up to 75

URI that is Non-prefix:

coupons up to 63

Considerations

Complex integrations involving various apps have frequently been implemented using VM transport. Without having to go through a transport stage, you can utilize "Flow References” for referring to one flow directly from another.

In some circumstances, VM is quite useful. Assume that the majority of your solution's components are local, however, few have to decouple to test or to be made remote.

Features

Request-response and one-way endpoints are two modes of operation for the VM in-memory transport.

request-response:

Messages are transmitted straightly from a VM outbound endpoint to a VM inbound endpoint which listens to the very same path when using request-response endpoints. This is a blocking delivery that takes place in the very same thread as the preceding one. When there is no inbound VM request-response endpoint on this path in the same Mule application, dispatching a message from the outgoing endpoint fails.

one-way:

Messages are transmitted to the related incoming endpoint through a queue when using one-way endpoints. This is a non-blocking delivery. If there isn't a one-way inbound endpoint that listens for this path in the same Mule application, the message will remain in the queue even if dispatching is successful. This queue will be stored in memory by default, but it’s also feasible to set up a persistent queue that leverages a file system for persistence.

Usage

To set up endpoints of a VM, adhere to these 3 steps. We'll go through every step on a deeper level further below.

1. Incorporate the namespace of MULE VM into your setup: 

  • Use this VM prefix to define the VM. 

coupons up to 55

  • Specify the schema's location. 

coupons up to 29

2. One or many connectors for endpoints of VM can be defined as an option.

Build a connector for VM:

coupons up to 59

Every VM endpoint utilizes a default connector when nothing is built.

3. Build VM endpoints.

  • Inbound endpoints receive messages.

  • Outbound endpoints are used to send messages.

  • A pathname or address is used to identify both types of endpoints.

VM Namespace Declaration

The VM namespace must be declared in the Mule configuration header file to use the VM transport. For instance:

Namespace Declaration for VM Transport

coupons up to 80

Endpoint Configuration

Endpoints are set up the same way as any other transport.

The VM namespace is used to configure the VM transport endpoints, which employ an address attribute or path. For instance:

coupons up to 97

Use an endpoint URI to call a VM endpoint from the Mule client. The following is the format of a VM endpoint Uri:

coupons up to 12

Using Transactions

Distributed XA Transactions can use one-way VM queues. Use a setup like this to make a VM endpoint transactional:

coupons up to 4

 

Adding a transaction manager to your setup is required to use XA.

Inbound Transactional VM Queues

Full transactional flows are supported via inbound VM endpoints. For example, because the inbound endpoint is one-way, the following configuration establishes a VM queue and processes messages read from it transactionally and synchronously:

coupons up to 73

There is also support for XA transactions:

coupons up to 60

Conclusion:

This article briefly summarizes the main concepts of VM transport in Mulesoft. To get further assistance, you need to upgrade your skills with the Mulesoft Online Training course where you will be learning the concepts like integration techniques with anypoint studio, recognizing the IT industry problems, etc. This would help you in accrediting the required credentials to get into the Mulesoft careers.

Latest Blog

The Benefits Of Taking Online Photography Classes

The Benefits Of Taking Online Photography Classes

Read more ›

Exploring the Effectiveness of Online Art Education: Advantages and Disadvantages

Exploring the Effectiveness of Online Art Education: Advantages and Disadvantages

Read more ›

What is Online Learning? Should You Invest in Online Courses?

What is Online Learning? Should You Invest in Online Courses?

Read more ›

Ultimate Taekwondo Course for Kids

Ultimate Taekwondo Course for Kids

Read more ›

Top Pet & Animal Care online Courses

Top Pet & Animal Care online Courses

Read more ›

The Benefits of TikTok Influencer Marketing for Your Business

The Benefits of TikTok Influencer Marketing for Your Business

Read more ›

Top 10 Most Popular Online Courses

Top 10 Most Popular Online Courses

Read more ›

Still Shine with Minimalist Fashion Trends

Still Shine with Minimalist Fashion Trends

Read more ›