Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

14.3. Using Spring

In addition to the scripting functionality offered by the scripting namespace, Mule can also take advantage of Spring’s dynamic language support. This affords you the ability to use scripts in places where there isn’t explicit schema support, as with components and transformers. Spring-managed scripts also have the benefit of being refreshable, as we’ll soon see. Let’s see how Spring’s scripting support augments Mule’s.

14.3.1. Implementing custom Mule functionality using Spring

So far we’ve seen how Mule provides explicit configuration support for scripted components and transformers through use of its scripting namespace. But what happens if you want to implement a custom router or filter as a script? In these cases, there’s no direct schema support for scripted implementations. When this is the case, you can take advantage of Spring’s scripting support offered by its lang namespace. The lang namespace allows you to define arbitrary Spring beans using JSR-223 scripts. You can then use these beans anywhere in Mule that takes a bean reference.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint