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.
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.
Syntax and Namespace
The following is the list of namespaces and syntaxes in VM transport.
Namespace in XML
Schema for VM
Location of the XML Schema
Syntax of Connectors
Persistent queues in a VM:
In-memory queues in a VM:
Syntax of Endpoints
The endpoint that is prefixed:
URI that is Non-prefix:
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.
Request-response and one-way endpoints are two modes of operation for the VM in-memory transport.
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.
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.
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.
2. One or many connectors for endpoints of VM can be defined as an option.
Build a connector for VM:
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
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:
Use an endpoint URI to call a VM endpoint from the Mule client. The following is the format of a VM endpoint Uri:
Distributed XA Transactions can use one-way VM queues. Use a setup like this to make a VM endpoint transactional:
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:
There is also support for XA transactions:
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.