Fetching Dynamic Properties in Dataweave Scripts

  Under normal circumstances Dataweave mapping is straightforward; you simply point to the source variable or payload property you want and inject it into the output. However, there are times where you don’t know which source property you need to use at design time. In such cases, the required property

Finding the Root of a Problem

  There are times when you need to fetch a file from your local file system on the application at runtime. In these cases, the Mule can look stubborn and confusing. For instance, some components (E.g. Transform components) allow you to navigate to the file in question and then display

A Whisperer’s Ongoing Search for Perfection

    Recently, I was posed with an interesting challenge; transform this array of key/value pairs: [ { “key”:”Key1″, “value”: “Value1” }, { “key”:”Key2″, “value”: “Value2” } ] … into this object: { “Key1”: “Value1”, “Key2”: “Value2” }   On the face of it, this should be easy. And yet…

TDD Pitfalls that Make a Mockery of Testing

  What to do When Mocks Fail Many years ago, I worked on a project that used Mock Services extensively. We wrote our code against those mocks and all went swimmingly. Then we switched to the real service. That is when things went awry.  The actual service were far less

Getting to Grips with OAuth 2.0

  In light of how prevalent OAuth 2.0 is as an authentication method, I found it surprising how few articles exist, explaining how to configure it in MuleSoft — especially in the context of an HTTP client.   The scenario In this scenario, we have an HTTP Request in our

Correlation — Thinking Outside the Box

  Correlation is an easy way to allow different systems to communicate with one another. Usually, we use a correlation ID as a common reference between multiple systems. When a system completes a given task, it can notify other systems in the network which, in turn use the correlation ID

Going Old-School with Multipart Form Data

  Recently, I came across an interesting integration use-case; an “API” that actually expected a multipart/form-data MIME type rather than the more conventional application/json or application/xml. Well, this triggered a sense of overwhelming nostalgia. It took me back to a time where we used web pages to complete forms which

How to Create Rich API’s Using RAML

  When building MuleSoft API’s, RAML is the starting point. It is from here that we design our API structure and it is from here that we generate our initial Mule Flows.    Handling null Values There is a plethora of RAML tutorials out there, both within and outside of

REST vs RPC API’s

  keep calm and carry on coding When it comes to designing API’s we often try to follow a Purist approach. We also find frustrating when external API’s do not follow that same ideal. Check out this great article by Phil Sturgeon that outlines the differences between REST vs RPC

Dealing With String Conundrums

  When it comes to String manipulation, Dataweave 2.0 offers a myriad of great out-of-the-box functions. However, even seasoned developers can begin to feel the frustration build when their Dataweave scripts don’t work as advertised; sometimes the Mule just appears to be stubborn. One such area is in the String