English 中文(简体)
1. 将Mule 1.3“模型”部分改为Mule 3当量
原标题:Converting Mule 1.3 "model" element to Mule 3 equivalent
  • 时间:2012-05-17 14:56:56
  •  标签:
  • mule

Im将1 Mule 1.3申请升级至3.2.1(最新版本)。 Mule 1.3 config文档有“模版”元素,有多个“单元-描述器”。

<model name="theModel">
  <mule-descriptor name="theName" implementation="com.company.SomeClass">
    <inbound-router>
      <endpoint address="servlet://service/foo" transformers="ACustomTransformer" responseTransformers="AnotherCustomTransformer" />
      <endpoint address="vm://anEndpoint"/>
    </inbound-router>
    <outbound-router>
      <router className="org.mule.routing.outbound.FilteringOutboundRouter">
        <endpoint address="Authenticator">
          <properties>
            <property name="propName" value="propValue" />
          </properties>
        </endpoint>
        <filter expression="/data = null" className="org.mule.routing.filters.xml.JXPathFilter" />
      </router>
      <router className="org.mule.routing.outbound.OutboundPassThroughRouter">
        <endpoint address="RequestValidator" />
      </router>
    </outbound-router>
    <properties>
      <property name="someProp" value="someValue" />
    </properties>
  </mule-descriptor>
  <!-- more <mule-descriptor> elements -->
</model>

我如何将其改为其第3卷的对应内容? 感谢。


EDIT - 5/29/2012

<>1> 一些 mu字器的rou形形形形形形色色。

<mule-descriptor name="theName" implementation="com.company.SomeClass">
  <inbound-router>
    <endpoint address="theName" />
  </inbound-router>
</mule-descriptor> 

如何将这些流动转化为第3卷流动? 当我利用你的答复中的信息将这些流动转化为流动时,我收到关于启动的错误信息,这似乎表明,由于流动仍在创造(如循环依赖):

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ref:RequestValidator.20 : Cannot resolve reference to bean RequestValidator while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name RequestValidator : Cannot create inner bean (inner bean) of type [org.mule.config.spring.factories.InboundEndpointFactoryBean] while setting bean property messageSource ; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name (inner bean) : 1 constructor arguments specified but no matching constructor found in bean (inner bean) (hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)

<>2> 1名 mu-descriptor将“彩虹”级改为“彩虹”级。 如何处理这些问题? Mule 3中不存在这一类。

<mule-descriptor name="theName" implementation="org.mule.components.simple.BridgeComponent">
  <inbound-router>
    <endpoint address="vm://theInboundAddress" />
  </inbound-router>
  <outbound-router>
    <router className="org.mule.routing.outbound.FilteringOutboundRouter">
      <endpoint address="vm://theOutboundAddress" />
    </router>
  </outbound-router>
</mule-descriptor>

3) Another mule-descriptor has a "matchAll" attribute in its <outbound-router> element. How should this be converted to a Mule 3 flow?

<mule-descriptor name="theName" implementation="com.company.SomeClass">
  <inbound-router>
    <endpoint address="servlet://theInboundEndpoint" />
  </inbound-router>
  <outbound-router matchAll="true">
    <router className="org.mule.routing.outbound.OutboundPassThroughRouter">
      <endpoint address="firstOutboundEndpoint" />
    </router>
    <router className="org.mule.routing.outbound.FilteringOutboundRouter" transformer="MyTransformer">
      <endpoint address="vm://secondOutboundEndpoint" />
      <filter pattern="Error*" className="org.mule.routing.filters.WildcardFilter" />
    </router>
  </outbound-router>
</mule-descriptor>

<>4> Mule 1.x config有一手<endpoint-identifier>,其名称与<mule-descriptor>s。 这些名字也作为终端地址在<mule-descriptor>上使用。 例如:

<endpoint-identifiers>
  <endpoint-identifier name="TheEndpointName" value="vm://theEndpointAddress" />
</endpoint-identifiers>

...

<model name="...">
  <mule-descriptor name="TheEndpointName" implementation="...">
    <inbound-router>
      <endpoint address="TheEndpointName" />
    </inbound-router>
    ...
  </mule-descriptor>
  ...
</model>

My guess is that the Mule 3 equivalent should look like the code below. Is this correct?

<flow name="TheEndpointName">
  <!--
    My first guess was:
    <inbound-endpoint ref="TheEndpointName" />
  -->
  <vm:inbound-endpoint path="theEndpointAddress" />
  ...
</flow>

再次感谢你。

EDIT 5/30/2012

<>5> 一些 mu字器使用<代码>RestserviceWrapper类别从Mule API。 当我把这段话转换成“第3号”(<代码><流程和>;时,我发现这一错误:

The required object/property serviceUrl is null

我注意到,Mule 1.x config的 mu描述人将财产称为“urlFromMessage”,这似乎说,除了在XML汇卷中提供的URL之外,它将作为财产提供给Mule电文。 但是,在《<代码>的Mule 3版中不存在“urlFromMessage”财产。 休息服务:。 我是否应该使用Mule 3的不同组成部分类别? 由于这一类别是穆莱普文的一部分,我是否应当使用标准XML标签? 感谢。

<mule-descriptor name="theName" implementation="org.mule.components.rest.RestServiceWrapper">
  <inbound-router>
    ...
  </inbound-router>
  <properties>
    <property name="urlFromMessage" value="true" />
  </properties>
</mule-descriptor>
最佳回答
  • model has been deprecated.
  • flow has replaced mule-descriptor

And many more, look at your config converted for Mule 3:

<flow name="theName">
    <composite-source>
        <vm:inbound-endpoint path="anEndpoint">
            <transformer ref="ACustomTransformer" />
            <response>
                <transformer ref="AnotherCustomTransformer" />
            </response>
        </vm:inbound-endpoint>
        <servlet:inbound-endpoint path="/service/foo" />
    </composite-source>
    <component>
        <singleton-object class="com.company.SomeClass">
            <property key="someProp" value="someValue" />
        </singleton-object>
    </component>
    <outbound-endpoint ref="Authenticator">
        <expression-filter expression="/data = null"
            evaluator="jxpath" />
        <property key="propName" value="propValue" />
    </outbound-endpoint>
    <outbound-endpoint ref="RequestValidator" />
</flow>

NB: This config is valid for Mule 3.2.1 but I can t guarantee it does exactly what you want, you have to test and tweak it!

More answers:

(1) 流动和终点使用不同的名称,现在他们登记为现场的个体户,因此不能分享相同的姓名。 这表明:

<flow name="theFlowName">
    <inbound-endpoint ref="theInboundName" />
    <component>
        <singleton-object class="com.company.SomeClass" />
    </component>
</flow>

2) Use the Bridge pattern:

<pattern:bridge name="theName"
                inboundAddress="vm://theInboundAddress"
                outboundAddress="vm://theOutboundAddress" />

3) Use the all routing message processor and use processor-chain to group several message processors as one:

<flow name="theName">
    <servlet:inbound-endpoint path="/theInboundEndpoint" />
    <component>
        <singleton-object class="com.company.SomeClass" />
    </component>
    <all>
        <outbound-endpoint ref="firstOutboundEndpoint" />
        <processor-chain>
            <transformer ref="MyTransformer" />
            <wildcard-filter pattern="Error*" />
            <vm:outbound-endpoint path="secondOutboundEndpoint" />
        </processor-chain>
    </all>
</flow>

4) 你可以宣布全球流动终点,你需要使用不同的名称来进行终点和流动,因此,实际的“组合3”当量是:

<vm:endpoint name="TheEndpointName" path="theEndpointAddress" />

<flow name="TheFlowName">
    <inbound-endpoint ref="TheEndpointName" />
    <component>
        <singleton-object class="..." />
    </component>
</flow>

5) Most Mule default components are now available as XML elements, so indeed you need to use:

<http:rest-service-component serviceUrl="..." />

取而代之:您可使用,以动态方式从飞行信息中提取URL。 例如,如果URL是用一个名为svcURL的附担保财产提供的。 使用:

<http:rest-service-component serviceUrl="#[header:INBOUND:svcURL]" />
问题回答

暂无回答




相关问题
Mule ESB - How to get MimeMessage instead of MimeBodyPart?

I m trying to get the FROM email address in Mule ESB. I m getting the retrieved object as MimeBodyPart, I d like to have MimeMessage instead. How to do this? Any solution - either in Mule or Java is ...

JaxWsProxyFactoryBean for Mule CXF transport?

I am new to mule. Are there any way to call CXF based web services using JaxWsProxyFactoryBean? It will be nice to reuse Java interface instead of wsdl files. With CXF we can simply reuse our java ...

Drools, spring and mule

Has anyone combined these technologies? Could you share lessons learnt?

How to keep inbound host with custom Mule ESB router

I created a custom router with one endpoint. The custom router looks up the destination of the endpoint based on the URL parameters of the inbound URL. I have an example of this up and running, and I ...

热门标签