Setup Mule, Maven and JDK in Windows

I will show you how to setup Mule, Maven and JDK in Windows environment.

Prerequisites

Mule Studio 3.x(Anypoint Studio) (Download from https://www.mulesoft.com/platform/studio)
Maven 3.2.1 (Download from https://maven.apache.org/download.cgi?Preferred=ftp://mirror.reverse.net/pub/apache/)
JDK 1.7 (Download from http://www.oracle.com/technetwork/java/javase/downloads/index.html)

Continue reading “Setup Mule, Maven and JDK in Windows”

Handling Default Exceptions in Mule

A catch exception strategy can be defined to customize the way Mule handles messages with errors. A catch exception strategy catches all exceptions thrown within its flow and processes them, thereby overriding Mule’s implicit default exception strategy.

Mule’s catch exception strategy behavior is similar to a Java catch block, except that a new exception cannot be thrown or another exception cannot be caught within a catch exception strategy. Continue reading “Handling Default Exceptions in Mule”

Handling Global Exceptions in Mule

A catch exception strategy can be defined to customize the way Mule handles messages with errors. A catch exception strategy catches all exceptions thrown within its flow and processes them, thereby overriding Mule’s implicit default exception strategy.

Mule’s catch exception strategy behavior is similar to a Java catch block, except that a new exception cannot be thrown or another exception cannot be caught within a catch exception strategy. Continue reading “Handling Global Exceptions in Mule”

Handling Local Exceptions in Mule

A catch exception strategy can be defined to customize the way Mule handles messages with errors. A catch exception strategy catches all exceptions thrown within its flow and processes them, thereby overriding Mule’s implicit default exception strategy.

Mule’s catch exception strategy behavior is similar to a Java catch block, except that a new exception cannot be thrown or another exception cannot be caught within a catch exception strategy. Continue reading “Handling Local Exceptions in Mule”

Choice Flow Control in Mule ESB

The choice flow control dynamically routes messages based on message payload or properties. It adds conditional programming to a flow, similar to an if/then/else code block.

A choice flow control uses expressions to evaluate the content of a message, then it routes the message to one of the routing options within its scope. It directs messages to the first routing option in the scope that matches the routing configurations (evaluates to true). If none of expressions evaluate to true, the choice flow control directs the message to the default (else) route. Continue reading “Choice Flow Control in Mule ESB”

Convert JAXB Object to XML in Mule ESB

In this tutorial I am going to show you how we can convert JAXB object into XML data in Mule ESB. We will use File Connector to take an XML file as input then we will map it to an appropriate JAXB object, then finally we will convert the JAXB object back into XML data.

You can see also Convert XML to JAXB Object in Mule ESB

The JAXB transformers allow objects to be serialized to XML and back again using the JAXB binding framework.

Java Architecture for XML Binding (JAXB) allows Java developers to map Java classes to XML representations. JAXB provides two main features: the ability to marshal Java objects into XML and the inverse, i.e. to unmarshal XML back into Java objects. In other words, JAXB allows storing and retrieving data in memory in any XML format, without the need to implement a specific set of XML loading and saving routines for the program’s class structure.

Mule support binding frameworks such as JAXB and Jackson. These frameworks use annotations to describe how data is mapped to a Java object model. Reference https://docs.mulesoft.com/mule-user-guide/v/3.7/jaxb-transformers

Continue reading “Convert JAXB Object to XML in Mule ESB”

Convert XML to JAXB Object in Mule ESB

In this tutorial I am going to show you how we can convert XML data into JAXB object in Mule ESB. We will use File Connector to take an XML file as input then we will map it to an appropriate JAXB object.

You can see also Convert JAXB Object to XML in Mule ESB

The JAXB transformers allow objects to be serialized to XML and back again using the JAXB binding framework.

Java Architecture for XML Binding (JAXB) allows Java developers to map Java classes to XML representations. JAXB provides two main features: the ability to marshal Java objects into XML and the inverse, i.e. to unmarshal XML back into Java objects. In other words, JAXB allows storing and retrieving data in memory in any XML format, without the need to implement a specific set of XML loading and saving routines for the program’s class structure.

Mule support binding frameworks such as JAXB and Jackson. These frameworks use annotations to describe how data is mapped to a Java object model. Reference https://docs.mulesoft.com/mule-user-guide/v/3.7/jaxb-transformers

Continue reading “Convert XML to JAXB Object in Mule ESB”

Convert file data to map-payload and insert into MySQL using Mule ESB

This tutorial will show you how to use Mule JDBC Transport to convert text file data to Map and insert into MySQL database in Mule based application. You may also review Mule JDBC Insert Example and Dump CSV data into MySQL Database using Mule ESB

Connectors provide an abstraction layer over data transport mechanisms. Connectors exist for things such as files, email messages, databases, JMS, and even Jabber messages. A connector saves you the tedium of having to implement the details of a particular communication mechanism yourself. This allows you to focus on solving your integration problem and not on the plumbing of a particular communications protocol.

The JDBC Transport lets you send and receive messages with a database using the JDBC protocol. Common usage includes retrieving, inserting, updating, and deleting database records, as well as invoking stored procedures, such as, to create new tables dynamically.

In our example, we’d require a File connector and a Database connector. The File connector would provide the payload or content which needs to be inserted into database. The Database connector would provide the capacity to insert the data or payload to the target database. Continue reading “Convert file data to map-payload and insert into MySQL using Mule ESB”

Dump CSV data into MySQL Database using Mule ESB

This tutorial will show you how to use Mule JDBC Transport to dump CSV data into MySQL database in Mule based application. You may also review Mule JDBC Insert Example

Connectors provide an abstraction layer over data transport mechanisms. Connectors exist for things such as files, email messages, databases, JMS, and even Jabber messages. A connector saves you the tedium of having to implement the details of a particular communication mechanism yourself. This allows you to focus on solving your integration problem and not on the plumbing of a particular communications protocol.

The JDBC Transport lets you send and receive messages with a database using the JDBC protocol. Common usage includes retrieving, inserting, updating, and deleting database records, as well as invoking stored procedures, such as, to create new tables dynamically.

In our example, we’d require a File connector and a Database connector. The File connector would provide the payload or content which needs to be inserted into database. The Database connector would provide the capacity to insert the data or payload to the target database. Continue reading “Dump CSV data into MySQL Database using Mule ESB”