The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

dvorme (14) [Avatar] Offline
#1
I want to integrate a Spring Bean into my Mule flow via MEL. Where would I go in the book to find how to do that? So far, I've read ch12, 13, the appendices, and scanned the rest but I'm just not finding how to do that.

More generally, I'd like to see more information on how Mule itself is put together--just enough information so I know how to extend Mule the way it was built to begin with, which is also likely to be the path of least resistance. Or am I missing that somewhere too?


Thanks,

Dave
David Dossot (233) [Avatar] Offline
#2
Re: Spring Bean integration / Extending Mule
You can call a method on a Spring Bean either by using a <component> element or an <invoke> message processor.

What do you want to achieve by extending Mule? This is actually the past of most resistance, ie coding to the private API of Mule, so you need to have a strong rationale for it.
dvorme (14) [Avatar] Offline
#3
Re: Spring Bean integration / Extending Mule
Thanks for the feedback.

I have a Java component that will do so work, and based on that work I want to branch to one (sub)flow or another.

And I'd like the branching to be visible in the Mule Studio visualization so I can take the result to an analyst and they can read it too.

What's the path of least resistance for that?


Thanks,

Dave
David Dossot (233) [Avatar] Offline
#4
Re: Spring Bean integration / Extending Mule
How many methods in your component can possible handle the message payload? If just one, you <component>, otherwise use <invoke> which is easier than using <component> + entry point resolvers (see chapter 6).

Then put a choice router after it to orient the message to the desired (sub)flow based on the outcome of your Java code.
dvorme (14) [Avatar] Offline
#5
Re: Spring Bean integration / Extending Mule
Thanks. I see <component> in chapter 6; where is <invoke>?

I'll respond further in another thread (comments on chapter 6).

Thanks again,

Dave