Queues and Mule Transport Mechanisms
By,
Harish Kumar
Queues

We can set up a VM queue explicitly to load balance across Mule
runtimes (nodes). Thus, if your entire application flow contains a
sequence of child flows, the cluster can assign each successive child
flow to whichever Mule runtime (node) happens to be available at the
time. Potentially, the cluster can process a single message on multiple
nodes as it passes through the VM endpoints in the application flow.

A high-reliability application must meet the following
requirements:
− Zero tolerance for message loss
− A reliable underlying enterprise service bus (Mule)
− Highly reliable individual connections
Mule Cluster Transport Mechanisms

Mule runtimes support three basic types of transports:

Socket-based transports read input sent to network sockets that
Mule owns. Examples include TCP, UDP, and HTTP[S].

listener-based transports read data using a protocol that fully
supports concurrent multiple accessors. Examples include JMS
and VM.

resource-based transports read data from a resource that allows
multiple concurrent accessors, but does not natively coordinate
their use of the resource. For instance, suppose multiple programs
are processing files in the same shared directory by reading,
processing, and then deleting the files. These programs must use
an explicit, application-level locking strategy to prevent the same
file from being processed more than once. Examples of resource-
based transports include File, FTP, SFTP, E-mail, and JDBC.

Mule HA Clustering automatically coordinates access to each
resource, ensuring that only one clustered instance accesses each
resource at a time. Because of this, it is generally a good idea to
immediately write messages read from a resource-based transport to
VM queues. This allows the other cluster nodes to take part in
processing the messages.
− There are no special considerations in writing to resource-
based clustered transports:
− When writing to file-based transports (File, FTP, SFTP), Mule
will generate unique file names.
− When writing to JDBC, Mule can generate unique keys.
− Writing e-mail is effectively listener-based rather than
resource-based.
Clustering and Networking

To ensure reliable connectivity between cluster nodes, all nodes of a
cluster should be located on the same LAN. Implementing a cluster
with nodes across geographically separated locations, such as different
datacenters connected through a VPN, is possible but not
recommended and not supported.

Linking cluster nodes through a WAN network introduces many
possible points of failure such as external routers and firewalls, which
can prevent proper synchronization between cluster nodes. This not
only affects performance but requires you to plan for possible side
effects in your application.

Ensuring that all cluster nodes reside on the same LAN is the best
practice to lower the possibility of network interruptions and
unintended consequences such as duplicated messages.
Clustering and Load Balancing

When Mule clusters are used to serve TCP requests (where TCP
includes SSL/TLS, UDP, Multicast, HTTP, and HTTPS), some load
balancing is needed to distribute the requests among the clustered
instances. There are various software load balancers available, two of
them are:

Nginx, an open-source HTTP server and reverse proxy.

The Apache web server, which can also be used as an HTTP(S) load
balancer.

There are also many hardware load balancers that can route both TCP
and HTTP(S) traffic.
Thank You !!

Queues and Mule Transport Mechanisms

  • 1.
    Queues and MuleTransport Mechanisms By, Harish Kumar
  • 2.
    Queues  We can setup a VM queue explicitly to load balance across Mule runtimes (nodes). Thus, if your entire application flow contains a sequence of child flows, the cluster can assign each successive child flow to whichever Mule runtime (node) happens to be available at the time. Potentially, the cluster can process a single message on multiple nodes as it passes through the VM endpoints in the application flow.
  • 3.
     A high-reliability applicationmust meet the following requirements: − Zero tolerance for message loss − A reliable underlying enterprise service bus (Mule) − Highly reliable individual connections
  • 4.
    Mule Cluster TransportMechanisms  Mule runtimes support three basic types of transports:  Socket-based transports read input sent to network sockets that Mule owns. Examples include TCP, UDP, and HTTP[S].  listener-based transports read data using a protocol that fully supports concurrent multiple accessors. Examples include JMS and VM.  resource-based transports read data from a resource that allows multiple concurrent accessors, but does not natively coordinate their use of the resource. For instance, suppose multiple programs are processing files in the same shared directory by reading, processing, and then deleting the files. These programs must use an explicit, application-level locking strategy to prevent the same file from being processed more than once. Examples of resource- based transports include File, FTP, SFTP, E-mail, and JDBC.
  • 5.
     Mule HA Clusteringautomatically coordinates access to each resource, ensuring that only one clustered instance accesses each resource at a time. Because of this, it is generally a good idea to immediately write messages read from a resource-based transport to VM queues. This allows the other cluster nodes to take part in processing the messages. − There are no special considerations in writing to resource- based clustered transports: − When writing to file-based transports (File, FTP, SFTP), Mule will generate unique file names. − When writing to JDBC, Mule can generate unique keys. − Writing e-mail is effectively listener-based rather than resource-based.
  • 6.
    Clustering and Networking  Toensure reliable connectivity between cluster nodes, all nodes of a cluster should be located on the same LAN. Implementing a cluster with nodes across geographically separated locations, such as different datacenters connected through a VPN, is possible but not recommended and not supported.  Linking cluster nodes through a WAN network introduces many possible points of failure such as external routers and firewalls, which can prevent proper synchronization between cluster nodes. This not only affects performance but requires you to plan for possible side effects in your application.  Ensuring that all cluster nodes reside on the same LAN is the best practice to lower the possibility of network interruptions and unintended consequences such as duplicated messages.
  • 7.
    Clustering and LoadBalancing  When Mule clusters are used to serve TCP requests (where TCP includes SSL/TLS, UDP, Multicast, HTTP, and HTTPS), some load balancing is needed to distribute the requests among the clustered instances. There are various software load balancers available, two of them are:  Nginx, an open-source HTTP server and reverse proxy.  The Apache web server, which can also be used as an HTTP(S) load balancer.  There are also many hardware load balancers that can route both TCP and HTTP(S) traffic.
  • 8.