Error handling in Mule 3.3: Catch Exception Strategy

Reading Time: 6 minutes

We put a lot of effort in Mule 3.3 to improve error handling in Mule ESB. One of the most common requirements during error handling was the ability to continue processing the same message that was being processed at the time of the exception. And that’s why that is the default behavior for the new exception strategies shipped with Mule 3.3.

Another very common use case was the need to differentiate between handled and unhandled exceptions within a flow. In this case we are going to focus on handled exception and the new catch exception strategy.

Continue reading

Connector Callback Testing – Local

Reading Time: 11 minutes

Testing using an external API can be a PITA, especially if the API uses any HTTP Callbacks or redirects such as OAuth or WebHooks. If your using any callback functionality like this then the Service Provider needs a way to callback your application and therefore be accessible to the public Internet.

When you start integrating these APIs, it’s much easier to work on your local development machine, but these are usually behind firewalls, NAT, or are otherwise not able to provide a public URL and it’s not really feasible to push to a staging environment every time you want to test something.

So we need a way to make our local applications available to the Internet; there are a few good services and tools out there to help with this such as: Tunnlr, ProxyLocal, showoff.io or you can setup your own reverse SSH Tunnel if you already have a remote system to forward you requests.

In this post, I am going to use a service called LocalTunnel and show how we can share a local Mule application with the world and customize some Cloud Connectors to receive Callbacks locally.

Continue reading

Welcome to Mule Enterprise

Reading Time: 18 minutes

Introduction


Those of you who are regular visitors to this blog are no doubt familiar with Mule Community Edition. With this blog I’d like to introduce you to MuleSoft and our Enterprise version of Mule, I think its important to understand everything that mule can offer you.

Reason for Success

So why do companies rely so heavily on Mule? Well, consider the legacy integration ESBs and Brokers. Most of them were built over fifteen years ago, so they solve only a subset of today’s integration challenges. These were and remain heavyweight stacks expensive to rollout and maintain and stubbornly resistant to change. MuleSoft in stark contrast is now leading the way with Mule Enterprise which was built to be agile in its ability to adapt to the changes which necessarily occur in any company’s business processes.  Mule’s success can be attributed to the following characteristics:

  • It´s Open: It’s open-source so you can see the quality of the code yourself, it’s built on standards, and it’s designed according to Industrial best practice to enable seamless communication with your existing and future infrastructure.
  • It´s Light, and it´s Fast: it can be deployed in some ways with a notable low resource usage and it out performs its competitor’s hands down!
  • It´s Developer friendly: it’s a tool written entirely for Developers with the aim to increases their productivity, so you´ll very quickly see the results of your efforts.
  • It´s Cloud ready: it’s built to run on the cloud, we’re focused on connecting application on-premise and cloud including SaaS, social media and infrastructure APIs and Mule applications can run on-premise on Mule ESB or in the cloud with CloudHub.

The Problem and its Solution

What is the nature of the Integration problem that Mule solves? Lets consider your current IT infrastructure. No doubt you have one or more databases. Perhaps you have some legacy systems which you’ve built up over the years. Perhaps you have some large third-party systems like SAP there. Now consider the complexity inherent to the point-to-point communication between these systems. IT requirements evolve and so over time you observe how you begin to connect system to system creating tight dependencies between different systems in your IT architecture. Now, the more systems that arrive on the scene, the greater and faster the problem of integrating grows. The growth of the problem is exponential. One more system added to the equation multiplies the cost of integrating by a number of systems you already have. Spaghetti becomes the defining characteristic of your architecture.    Let us now introduce Mule Enterprise to clean up the mess and become the main player for all future integration by centralising, standardising and simplifying that communication.

What about the cloud?

Perhaps you’ve already decided to utilise some SAAS services or are concerned about the difficulty of embracing such software in the future. What can Mule do here? Exactly what it can do for your organisation: seamless integration both from a cloud-to-premise perspective and from a cloud-to-cloud perspective. MuleSoft’s AnyPoint technology affords you the luxury of every possible flavour of integration: Mule CloudHub is an elastic and multi-tenanted cloud that allows you to integrate cloud and on-premise applications using Mule Enterprise.

 

 

 

 

 

A Panoramic View of Mule Enterprise

MuleSoft’s Enterprise Integration Platform covers every area of the integration effort by providing the best tools on the market to help with the development, deployment and management of your integration applications. And far from constraining you with our way of seeing things, we give you the liberty of extending Mule. Let´s take a deeper look at the toolset from the perspective of each of these:

Development

Building Blocks

Mule Studio Enterprise graphically surfaces the Enterprise Integration Patterns that guided the core architecture of Mule itself in the form of building blocks. These intuitive jig-saw pieces cover all the core ingredients found in every integration solution, namely connectors, transformers, routers and processors and which you can drag and drop on to your solution canvass to form what we like to call Flows. As the name suggests, Flows represent the flow of information through Mule from and to the external systems which you need to integrate.

Graphical Development

The graphical interface is a visualisation of the simple XML domain specific language which declares what you need to do and frees you from the effort of working out how to do it! Mule Studio allows you to build your Flows using a two-way editor. Changes in one view are immediately reflected in the other!

Data Mapping

A rather expensive part of integration manifests itself in need to transform large sets of data from one form to another. This is a common problem as the various systems which you desire to integrate don’t always speak the same language, so to speak. Mule Studio Enterprise addresses this problem with it’s powerful Data Mapper tool. Again the graphical drag and drop mappings let you see at a glance the details of your transformation logic.

Deployment

Mule Studio Enterprise reduces Integration Application deployment to a one-click affair! The target of your deployment can be the MuleStudio Embedded Server, your on-premise Mule Server, the Mule Management Console Application Repository or even CloudHub, Mule Enterprise on the Cloud!

Management

A deployed application must be watched and maintained to ensure plain sailing at every moment. Mule Enterprise Management Console provides you not just with entire visibility of your solutions at every level from Server to Messages but also gives you the power to act on that visibility by controlling the executions of artifacts on the same levels.

You can enforce Service Level Agreements on the performance of your applications and servers, receive Alerts based on the same and enjoy the thorough analysis of Key Performance Indicators, so critical to the success of your business, through Business Events. Troubleshooting any problems with your applications is a breeze with our Message Flow Analyser – a window to the even the most minute detail of the messages flowing though Mule. For your greater peace of mind, access to the Console can be restricted according to the roles you may already have defined in your LDAP server.

 

 

Extension

Mule covers a world of connectivity and message processing with its rich offering of endpoints, transformers and routers.

Connecting Endpoints

With respect to connectivity, the array of endpoints covers the most widely used communication mechanisms. We don’t stop there, however. These connecting endpoints have been extended with our suite of cloud connectors, which allow you to exploit the exponential growth in cloud-based software and public APIs. Talking to the likes of Salesforce, Twitter, etc. is as simple as using any other endpoint in a Mule flow.

Transformers and Routers

While our vast array of transformation and routeing processors satisfy the majority of use cases, our Java processors allow you to implement your custom integration logic. Likewise, our Scripting processors allow you to do the same in Mule Expression Language, Groovy, Python, Ruby, JavaScript, PHP and indeed any language which implements the JSR-223 scripting spec for the JVM. These extension capabilities multiply the power of Mule as an integration platform, which is completely adaptable to the needs of the integration project. Rather than constrain the developer, Mule offers itself as a tool to solve every integration problem with its wealth of out-of-the-box processors and its limitless extensibility.

DevKit

Mule’s powerful extension capability is made even easier with the DevKit, which facilitates the encapsulation of complex business processing logic or any complex interaction with external systems or cloud APIs as a set of message processors which can be presented on Mule Studio´s pallette as yet another out-of-the-box flow building block.

High Availability for Mission-Critical Deployments

The mission critical deployments we have seen in many companies are all thanks to Mule Enterprise’ High Availability solution. Its Shared Memory Grid technology guarantees you zero message loss for those highly important applications which you need to have running around the clock. You can cluster servers as a single unit to cater for automatic failover and re-balancing as well as automatic coordination of access to resources such as files, databases and FTP resources. All of this is transparent to the developer who needs not make any special considerations about the nature of her deployments!

Community or Enterprise?

Hopefully, the things we’ve spoken about here will make a choice obvious, but let’s just summarise exactly when you should go for Mule Enterprise Edition:

  • Data Mapper: Rapid development and maintenance of complex transformations with a Graphical Mapping of data between various formats which permits one to many and functional mappings including data-source lookup for runtime resolution of the mapped values.
  • SAP Connector: Our Connector is the first ESB connector to be certified by SAP. Simplify access to SAP, one of the most popular Enterprise Resource Planning () solutions on the market, by sending and receiving iDocs and JcoFunctions and transforming the same to and from XML.
  • JDBC: The Enterprise Edition Endpoint boasts batched statements, JDBC – Xml / CSV transformations and Stored Procedure execution.
  • Cache: Avoid unnecessary hits to your database or Webservice or any other Mule Flow by caching the results of the invocation based on any criteria determined by runtime evaluation of a Mule Expression. The result of this is used as key to the cache so that future messages which match the same criteria will result in data pulled from the cache rather than invocation of the wrapped Message Processors.
  • FTP: Control minimum age of retrieved files and where to store read files with the FTP Endpoint.
  • High Availability: Our Clustering Solution allows you to group Mule Servers together and have them act as a single virtual Server with automated load-balancing and failover between nodes, management of Resource based endpoints and guaranteed Zero Message Loss.
  • Centralised Management: With Mule Enterprise you get absolute Visibility and Control of everything of concern to you: from Mule Servers to the Applications deployed on those Servers, to the Flows executing inside those Applications and right down to the level of Messages passing through those Flows.
  • Business Events: Mule Enterprise captures the extremely important information passing through our platform, thus facilitating the identification of Key Performance Indicators, in the form of Business Events which can be surfaced and saved to the database of your choice.
  • Service Level Agreements: can be enforced to prevent issues with any of the above from becoming problems. All of this displayed in a panoramic “see everything at a glance” centralised dashboard.
As I said before the goal of this post is just to provide awareness since many community members don’t know the difference between Mule Community and Enterprise.  Of course, developers don’t believe before they see and you can download a trial version of Mule Enterprise and see these capabilities for yourself. Feel free to contact us if you want to know more.

Mule School: DataMapper Testing Mappings and POJO inputs

Reading Time: 6 minutes

One aspect of Mule DataMapper that makes it a grate data integration tool is its ability to do mappings involving complex and different data structures (XML, Json, POJOs, CSV, Excel files and more). One feature that is really attractive is the possibility to test your mappings without the need to launch your Mule application, so that you can provide sample input data and preview what the result of the DataMapper will be.

After reading this post you should be able to:

  • Understand how to add and use Input Arguments
  • Test your mappings with the Preview Functionality
  • Create an input POJO to test the mapping

What are Input Arguments?

The DataMapper component maps/transforms anything that comes in the Mule flow payload into another format. But what happens when you want to enrich the contents of the payload, by sending other values that should be used as input for the mapping? For these cases you can use Input Arguments by defining a name and a value. The value can be a literal or any Mule Expression that returns a native value (String, Integer, Long, Double, …).

Adding Input Arguments to your DataMapper Component

Let’s start with a simple mule flow that has a DataMapper component. For simplicity we will start with a VM inbound endpoint (where the mapping input POJO will be received), a DataMapper component and a file outbound endpoint to save the output into a CSV file.

Now lets add the input arguments. If not done yet, first run the DataMapper wizard. In this case I created a Pojo to CSV mapping providing a sample java class and a sample csv file (download the sample Studio project with both files from here). Input arguments are created from the mapping editor.

Right click on the Input arguments label and click on Add input argument. Complete all details in the editor:

  • Name: Is the name used to display the input argument in the mapping editor
  • Type: Choose the variable type of the argument
  • Mule expression: Literal or expression that will generate the value in runtime

Previewing your mappings

DataMapper comes with a preview functionality that allows you to run the mapping without the need of starting the Mule application. As there is no runtime, you need to provide the input values yourself. In order to do this you should go to the preview tab (1) and then provide values for the input pojo (2) and the input arguments (3).

Sampling the input Pojo

  1. Create a groovy script that builds, set values and return an instance of your java object
  2. Choose the groovy script you created by clicking the button (2)

Sample Groovy Script used in this example (Please forgive my bad groovy skills!)

Providing values to Input arguments

  1. Click on the Input Arguments button (3)
  2. Select the input argument from the table list and provide a value

The only thing that’s left now is to Run the Mapping and check the results in the Text pane!

That was all. You can use the preview functionality for other types too, so I invite you to try them and get back to me with your feedback!

New CloudHub Platform Service for Application Data Storage

Reading Time: 7 minutes

We’ve just rolled out a new platform service in our CloudHub R20 release for storing application data. With Mule’s Object Store capabilities, each CloudHub integration application is given it’s own storage, with zero configuration required. This makes it a extremely easy to implement two very important integration scenarios:

  1. Persisting OAuth tokens – all our OAuth enabled connectors can store tokens and restore them using ObjectStores
  2. Storing synchronization state – your application may need to keep track of the last record synchronized, so the next time it synchronizes it can resume where it left off

In addition, you can store any other data you want in it as well! Let’s take a more in depth look at these scenarios.

Continue reading

Pattern-Based Configuration: Hello HTTP Proxy!

Reading Time: 6 minutes

The configuration patterns series continues with this new installment!

We’re happy to announce that a new configuration pattern made its way into Mule 3.3. This new pattern, named HTTP Proxy, will come in handy when remote web resources need to be accessed in a controlled manner, for example when it is not desirable to have numerous internal applications depend directly on external services.

It also supports caching, which allows you to reduce the outbound traffic towards regularly (and of course cacheable) web resources.

Continue reading