Intercepting Messages on TCP/IP in Mule

mule intercepting message

In this article, we will see how Mule can intercept messages on the TCP/IP socket for real-time communication. You will first receive messages on the TCP/IP socket and then transform the messages from byte to object, then from object to XML, and then, finally, from XML to JSON––all using out-of-the-box Mule transformers.

The TCP transport allows users to send or receive messages over TCP connections. TCP is a layer above the IP.

Weaving it with Dataweave expression

We all know how powerful Dataweave Transform Message component is. This is such a powerful template engine that allows us to transform data to and from any format (XML, CSV, JSON, Pojos, Maps, etc. basically ).

So if we need to transform we need a Dataweave component in our flow. But wait! Dataweave also provides us a function called Dataweave function that helps us to execute Dataweave language outside a Dataweave transform component.

HowTo – Build a REST API with XML payload

There is hardly any argument on the fact that APIs are increasingly becoming an important part of how companies do business. API has become the de facto standard to unlock one of their most valuable resources, data.

And as organizations are publishing more APIs, the observed trend is that REST is replacing SOAP as the data transfer protocol of choice. When it comes to the data that APIs serve up, XML is still the most used format.

Encrypt Specific XML Tags With The Power Of DataWeave

DataWeave is a powerful language, and the possibilities of what you can do with it are infinite.

In this blog post, I am going to show you how to select specific data inside a series of specified XML tags.

For example, in this case we want to encrypt data inside sensitive XML tags such as an SSN, a credit card number, etc.

We define an array with the XML tags to be encrypted named keyToEncrypt (we are encrypting just the contents,

XPath Performance boost using Mule 3.6

This character is QuickSilver and he’s the fastest of the X-Men. Mule 3.6 has no super powers, but when it comes to XPath, it’s the fastest ever! As you may remember, with the release of Mule 3.6.0 the XPath and XSLT was revamped. In this post, I’d like to not only continue elaborating on how great the improvement is, but also focus on a new aspect: Performance.

You’re into XML? Mule now supports XPath, XSLT and XQuery 3.0


In spite of JSON’s reign as the king of API data format, XML still remains the exchange data format of choice for a number of systems. Any service exposing functionality through SOAP, and many application built years ago (or even nowadays) still depend on XML to share data – to such an extent that in April 2013 the W3C published a new spec for version 3.0 of the XPath, XSLT and XQuery standards.

Fending off XXE attacks in Mule 3.5


Trust no one! Most security issues comes from assuming that no bad person is going to tamper with your input data. We usually pay more attention to it when processing the most common inputs, such as an HTTP request or some argument that’s going into an SQL query. But we usually don’t pay much attention to other types of resources that are also vulnerable to malicious thinking – such as an XML file.

Mule and JAXB: turning an XSD file into an XML Fiesta!


Hello friends! How’s it going?

Has the following ever happened to you? You show up to work one morning and your boss tells you, “I need you to take this data and turn it into XML.” Well, this has happened to me, and in this blog post I’m going to show you how to do this quickly.

Using XPath expressions on an XML document with namespaces

February 17 2012

3 comments 0

The other day I helped a customer figure out a little XPath problem: they had an XML document and wanted to process it depending on an XPath expression. Here’s the Mule config that shows what we were trying to achieve:

Validating complex XML messages with Mule and AbsoluteRule


It is pretty common that Mule messages contain XML as a payload and that those messages need to be validated/transformed. XML documents can be automatically validated using XSD, though those validations are structural and sometimes we need to manually code some validation in plain Java (especially in complex scenarios like validating references, existence conditions and value dependencies).