I have already presented how to call Java code using messages processors with the newest Java Module for Mule 4.x. For earlier mule’s version Entry Point Resolvers were used to invoke custom Java code. However for scenarios when we would like to use custom code in DataWeave, for transformations, another approach is needed. Approach presented in this article will be more concise comparing to using message processors. It was highly extended comparing to possibilities of Mule 3.x version. Mule 3 allowed to invoke static methods. In contract Mule 4 not only permits to call static methods but also instantiate classes and access its instance attributes.
Is my service healthy? How to for Mule 4 Runtime.
Last Updated on 27/03/2021 by Patryk Bandurski It is a good practice to monitor your service and check whether it is available and/or is performing as expected. To do this, we need to specify what the service’s health term means. In this article, I will present two different definitions. However, keep in mind that you can…
How to convert decimal number into integer using DataWeave
Last Updated on 03/05/2021 by Patryk Bandurski This article is about converting decimal numbers into integer ones. This may seem tricky at first. You may say that we do not need to do anything special and the DataWeave engine will handle it underneath. However, there is a nuance that you should be aware of. In…
Mule 4 new Java Module
In one of my previous posts I described Java Component and entry point resolvers as a way to invoke Java Code in Mule 3.x. In this article I will focus on completely new approach in Mule 4. Mule presents brand new Java Module capable of creating new instances, invoking methods on those instances and invoking static methods. Although you can invoke Java using DataWeave 2.0 and Groovy scripting you are losing additional metadata (DataSense). So lets walk through some sample application.
How to avoid repetition in DataWeave for conditional checks?
Last Updated on 30/05/2021 by Patryk Bandurski Tip number 1 will be about data existence check. There is often a situation that nearly the same conditions need to be checked in every line. I have seen many transformations that were really long and complex. Reading them was not only difficult but a lot of repeatable…
Entry Point Resolver how the message is passed
Sometime it is needed to use custom JAVA code to processes current message. Developed custom code is known as Java Component. How mule knows which method should invoke and what parameters should be there passed? There are some rules that your class may full fill in order to work without any additional configuration. However when you have more sophisticated use case or class is fairly complex you would probably need Entry Point Resolver configured. I will explain on simple examples some of them. This is valid for Mule version 3.x. In next article I will describe in more detail new Java Module available in version 4.x.
Cache or not to cache
For high-workload application it is important to manage resources efficiently. One of the tricks that can save resource usage is caching. In RESTful services this technic is used in GET methods. However it may by used in other cases when operation of getting particular resource can be reused. In this blog post I will extend previously design rest service by adding caching to two operations. Mule uses Cache Scope component. Apart from describing it I will show you possible obstacles and how to handle them.
Implement simple GET operations using Flow Designer
Last Updated on 02/05/2021 by Patryk Bandurski HTTP GET method’s simple design has been published in a previous article. I designed the account service using the RAML specification. It is time, now, to implement that service so our potential users could consume it. To implement the service I use Flow Designer available on Anypoint Platform….
Most Valuable Blogger Program
Recently I have decided to join Most Valuable Blogger (MVB) Program on DZone. Some articles, selected by DZone, will be republished and available on their site. So if you follow them you won’t miss any of my articles.
Best practices to design REST GET method on Anypoint Platform
Last Updated on 30/05/2021 by Patryk Bandurski This article is an intro to a blog series about HTTP methods usage in RESTful services. As a GET is the most common, I will start with it. This method is used for retrieving the collection of resources or a single resource. In other words, GET can be…