Virtual Machine transport in Mulesoft

Posted by: Diana Kihn at 02/08/2021 4,750 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 59

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 81

Syntax and Namespace 

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

Namespace in XML

Schema for VM

coupons up to 14

Location of the XML Schema

coupons up to 10

Syntax of Connectors

Persistent queues in a VM:

coupons up to 21

In-memory queues in a VM:

coupons up to 32

Syntax of Endpoints

The endpoint that is prefixed:

coupons up to 43

URI that is Non-prefix:

coupons up to 55

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 1

  • Specify the schema's location. 

coupons up to 4

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

Build a connector for VM:

coupons up to 0

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 13

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 38

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 17

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 79

 

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 2

There is also support for XA transactions:

coupons up to 82

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

Tips for making a convincing business plan for investors

Tips for making a convincing business plan for investors

Read more ›

The Most Used Quality Management Methods In The Enterprise

The Most Used Quality Management Methods In The Enterprise

Read more ›

The most common errors in WordPress and how to fix it

The most common errors in WordPress and how to fix it

Read more ›

Tips to make money easily with Google AdSense

Tips to make money easily with Google AdSense

Read more ›

10 useful tips for more effective teamwork

10 useful tips for more effective teamwork

Read more ›

10 short-term architectural design courses for busy people

10 short-term architectural design courses for busy people

Read more ›

9 books you should read before the age of 30

9 books you should read before the age of 30

Read more ›

Steps To Do Marketing Strategy For New Technology Products

Steps To Do Marketing Strategy For New Technology Products

Read more ›

Trending Searches