Logging just got a lot easier in Mule 3.1

Reading Time: 6 minutes

Mule 3.1 introduces a very useful new <logger> element that makes it easy to inspect the content and properties of your messages in Mule while building or debugging a flow. It’s also perfect for logging errors, info messages etc.  Mule has always supported logging with the <log-component> but while working with the new orchestration capabilities of Mule 3 flows, we found a real need for fine-grained logging. With the new message processor architecture, this was a snap and we were able to put together the new functionality in an afternoon. In this blog post I’ll take you on a quick tour of what you can do with it with some examples.

Let’s start with the basics and work through some examples:

Continue reading

PGP module reloaded!

Reading Time: 2 minutes

With the release of Mule ESB 2.2.7 (and the upcoming 3.1.0), you will see a reloaded version of the PGP module. The previous version was using the Cryptix library which currently RIP and doesn’t handle large files.

The new version uses the bouncy castle library which allows handling encryption and decryption using streams. We have added some integration tests that were necessary to update the library and the code safely. Also we have some time to do some memory profiling analysis.

To validate that the current implementation handles really complex and big cases we created a small example with 2 services:

  • An encryption service that reads files from one directory and outputs the encrypted file to a different directory.
  • A decryption service that reads files from the encrypted directory and outputs the decrypted version to a different directory.

The Mule config is the following:

Continue reading

Overcoming the Eclipse XML autocomplete bug

Reading Time: 4 minutes

Mule configuration files are Spring XML files by nature. So the XML editor is an important development tool and provides a lot of benefit. When working in Eclipse, it provides:

  • Schema documentation assistance for the element you are configuring
  • Validation of your schema and context of any errors that are detected
  • Autocomplete of elements and attributes based on what is valid in the current element of configuration you are editing

However, Eclipse’s XML editor (provided as part of the WTP project) does not properly handle autocomplete with schema substitution groups. Unfortunately, we use those substitution groups a lot in Mule so we filed a bug with the Eclipse project. Half a year later someone attached patch to address the issue. Since then there was not much activity on the issue with respect to getting the fix into an Eclipse release.

As part my work on Mule IDE I sat down and created an update site that you can use to install the patch from. Our list of favorite Eclipse XML editor bugs has the update site links.

Continue reading

Announcing Mule 3.1 Release Candidate 1

Reading Time: 5 minutes

The Mule team is pleased to announce the availability of the first release candidate for Mule ESB 3.1. This is a continuing evolution of the Mule 3 architecture, first introduced in Mule 3.0 , and follows hot on the heels of our most recent release, Mule ESB 3.0.1.

The biggest enhancements in Mule 3.1 are the new features for Mule Cloud Connect. It is now very simple to, for instance:

  • Invoke a cloud service.
  • Use the data it returns to invoke other services
  • Combine the data returned by all of these services
  • Use the result to invoke yet another service (or write it to a database, or persist it as XML, or format it as a web page, or…There’s really no limit but your imagination.)

The three main innovations here are

  • invoke, which makes calling a cloud service a snap.
  • poll, which makes it easy to poll a service for incoming data.
  • enricher, which lets you combine data from many different calls into one rich message.

In addition, Mule configurations now support a simple yet powerful logging facility, which provides access to log4J levels and categories together with the full range of Mule expressions. For instance,

Continue reading

Mule 2.2.7 Enterprise Released

Reading Time: 3 minutes

I’m happy to announce the release of Mule ESB 2.2.7 Enterprise. This release represents the most stable version of Mule ESB, with over 400 bug fixes since Mule ESB 2.2.1 Community.

This release includes several important improvements to Mule ESB that were developed in close collaboration with our customers:

  • The JDBC transport in Mule is now more flexible and enhanced with additional native support for database platform-specific features (for more info). Some highlights include:
    • Extended SQL parameter definition
    • Support for Sybase stored procedure calls
    • New SqlCommandExecutors to execute simple, prepared or callable statements
    • Support for retry policy on SQL command execution
    • New SqlStatementStrategies and factories
    • Support for stored procedure calls at inbounds
  • For Mule 2.2.7, the PGP Security module has been upgraded. Improvements include:
    • The cryptography library has been replaced with a newer, more robust library
    • Better performance and memory management when encrypting/decrypting large message payloads
    • Streaming support
    • Allow checking for expiring keys
    • Message compression
Continue reading

SOAP and REST are not interchangeable

Reading Time: 4 minutes

Recently I saw this question posted in a forum: “Does REST have better performance than SOAP”?

This question is symptomatic of a fundamental misunderstanding of REST, I think. SOAP is a particular protocol used to implement RPC functionality. REST, on the other hand, is not a technology or protocol, but an architectural style. Systems that were built with the REST architectural style are fundamentally different from RPC based systems. For REST, we think in resources and data. For RPC we think in methods and actions. You can’t just swap one out for the other, because they are not even in the same category of things.

Comparing the performance of REST to SOAP is like asking: “What tastes better? ‘Stir fried’ or ‘zucchini’?” or “Which one is better? ‘Darth Vader’ or ‘Star Trek’?” Those question just don’t make any sense. People who think that they do are probably the same who think that REST is nothing but “RPC via URI”, which of course it is not.

You can ask whether a RESTful system, using HTTP as protocol, would have certain advantages or disadvantages compared to an RPC based system, using SOAP (over HTTP) as protocol. And even then you need to look at the system you are trying to implement and its specific requirements.

Continue reading

Routing with Message Processors in Flows (Part 1)

Reading Time: 5 minutes

One of the joys of Mule 3’s new Message Processor (MP for short) architecture is the power that arises from being able to combine message processors into different patterns.  To make this as flexible as possible, the routing message processors that were designed to be used in flows each do a single job, making them highly reusable. This allows you to build up a flow piece by piece, or alternatively modify an already working flow, without having to change its basic structure. Let’s look at an example.

We begin with a very basic flow that reads files from a File endpoint, checks that they’re XML, and and sends their contents to an HTTP endpoint:

Continue reading

Announcing Mule’s Activiti transport

Reading Time: 5 minutes

Hi all!

A couple of weeks ago I started the integration between Mule ESB and Activiti BPMN. Activiti is a Business Process Management (BPM) and workflow system targeted at business people, developers and system admins. Its core is a super-fast and rock-solid BPMN 2 process engine for Java. It’s open-source and distributed under the Apache license. Activiti is being written from the ground up with the requirement that the engine should be easily embedded and that the project would be aimed at developers not the business. This is a very natural fit for MuleSoft since our approach to middleware starts with the developer. We have been working with the Activiti guys since July focusing in the integration aspects of the project.

The idea behind Mule’s Activiti transport is that you are able to perform several administrative actions in an Activiti server from Mule. For example, let’s suppose that you would like to retrieve the candidate tasks of the user kermit, do some processing and CLAIM a subset of those tasks. The following configuration will work for you:

<activiti:connector name="actServer"
    activitiServerURL="http://localhost:8080/activiti-rest/service/"
    username="kermit" password="kermit" />

<model>
    <service name="Activiti service">
        <inbound>
            <activiti:inbound-endpoint activiti-server="actServer">
                <activiti:list-candidate-tasks user="kermit" />
            </activiti:inbound-endpoint>
        </inbound>

        <component class="org.mule.transport.activiti.SelectTaskComponent" />
        
        <outbound>
            <multicasting-router>
                <vm:outbound-endpoint path="out" connector-ref="asynchVm" />
                <activiti:outbound-endpoint activiti-server="actServer" >
                    <activiti:perform-task-operation operation="CLAIM" />
                </activiti:outbound-endpoint>
            </multicasting-router>
        </outbound>
    </service>    
</model>

Continue reading