简体   繁体   English

从Java类调用Mule流-Spring Boot

[英]Invoke a Mule flow from a java class - Spring Boot

I want to invoke a mule flow from a java class(the flow already listens to VM endpoint) which I can do it from the creating a mule client as below :- 我想从一个Java类中调用一个ule子流(该流已经侦听VM端点),我可以通过创建一个ule子客户端来做到这一点,如下所示:

MuleClient client = new MuleClient(muleContext);
client.dispatch("myEndPoint", "Message Payload", null);

However, I create the mule context while application start, ie Spring Boot main method. 但是,我在应用程序启动时创建了ule子上下文,即Spring Boot main方法。

How can I pass the mule context to any java class so that the method that can be used to send message by creating a mule client as shown above? 我如何将ule子上下文传递给任何java类,以便通过创建ule子客户端(如上所示)来发送消息的方法?

Please reference the below blog which explains how to do this: http://bushorn.com/running-mule-from-java/ 请参考下面的博客,其中介绍了如何执行此操作: http : //bushorn.com/running-mule-from-java/

HTH 高温超导

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM