Virtual Machine transport in Mulesoft

Posted by: Molly Heidenreich at 07/12/2021 4,276 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 36

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 10

Syntax and Namespace 

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

Namespace in XML

Schema for VM

coupons up to 96

Location of the XML Schema

coupons up to 40

Syntax of Connectors

Persistent queues in a VM:

coupons up to 16

In-memory queues in a VM:

coupons up to 88

Syntax of Endpoints

The endpoint that is prefixed:

coupons up to 82

URI that is Non-prefix:

coupons up to 96

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 77

  • Specify the schema's location. 

coupons up to 83

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

Build a connector for VM:

coupons up to 37

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 25

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 8

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 83

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 63

 

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 98

There is also support for XA transactions:

coupons up to 30

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

Creating A Digital Marketing Strategy for Your Moving Company

Creating A Digital Marketing Strategy for Your Moving Company

Read more ›

Deep Learning and Machine Learning - Find Out The Difference!

Deep Learning and Machine Learning - Find Out The Difference!

Read more ›

Why Should You Learn SQL No Matter Your Jobs?

Why Should You Learn SQL No Matter Your Jobs?

Read more ›

Persuasion Techniques to Thrive Your Career in Sales and Marketing

Persuasion Techniques to Thrive Your Career in Sales and Marketing

Read more ›

The 7 Best Persuasion Course Online You Shouldn’t Miss

The 7 Best Persuasion Course Online You Shouldn’t Miss

Read more ›

Why is Technical Writing So Hard?

Why is Technical Writing So Hard?

Read more ›

Make You Stand Out: Simple Tips to Write an Impressive CV 2021

Make You Stand Out: Simple Tips to Write an Impressive CV 2021

Read more ›

How to Improve Children’s Reading Skills Using the Internet

How to Improve Children’s Reading Skills Using the Internet

Read more ›

Trending Searches