English 中文(简体)
Mule EnricH 与即将到来的波霍
原标题:MULE ENRICH with incoming pojo
  • 时间:2012-05-24 06:43:23
  •  标签:
  • esb
  • mule

我要添加一些关于连接波霍的额外信息, 我用的是在骡子中的电文浓缩器, 并且这样做, 这是我的完整流。 我正在使用子流获取有效载荷, 并在 DB 中选择一些值, 并在相同的 pojo 和返回中设定该值, 在目标我被设定为有效载荷时, 但我正在获取错误, 比如这个“ 使用有效载荷的表达式增益器” 没有在 Mule 上注册 。

这里就是流动

<enricher doc:name="Message Enricher">
        <core:flow-ref name="flows1Flow1" doc:name="Flow Reference"/>
        <enrich source="#[groovy:payload]" target="#[payload]"/>            

<logger message="AFTER Enrich: #[payload]" level="INFO" doc:name="Logger"/>
    <component class="com.enrich.AfterEnricher" doc:name="Java"/>


 <sub-flow name="flows1Flow1" doc:name="flows1Flow1">
    <component class="com.enrich.MessageEnrichPattern" doc:name="Java"/>
    <jdbc:outbound-endpoint exchange-pattern="request-response" queryKey="selectData" connector-ref="jdbcConnector" doc:name="Database (JDBC)">
        <jdbc:query key="selectData" value="SELECT Username, Password, ModuleId from Credentials where ModuleId=#[map-payload:moduleId]"/>
    </jdbc:outbound-endpoint>
    <logger message="#[payload]" level="INFO" doc:name="Logger"/>
    <component class="com.enrich.ReceiveMessageEnrichPattern" doc:name="Java"/>
</sub-flow>

在此接收Message Enrich Patter 重新认证

Credential credential = new Credential();
    credential.setUname(hashMap.get("USERNAME").toString());
    credential.setPwd(hashMap.get("PPPP").toString());
    credential.setMid(hashMap.get("MODULEID").toString());
    return credential;

请帮助我如何用额外的信息来丰富我即将到来的Pojo。

问题回答

根据"http://www.mulesoft.org/document/display/MULE3USER/Expressions+Configuation+Reference#ExpressionsConfigifationReference-Enrichers" rel=“nofollow”>docs , Mule目前只支持两个浓缩目标:

  • flow variables,
  • message headers.

为了实现你们的目标,你们需要:

  • store the enricher result (Credential object) in a flow variable,
  • use a custom transformer to copy the values from the Credential object found in the flow variable to the POJO payload in your main flow.




相关问题
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 ...

Benefits of an enterprise service bus

Where can I find some information on the uses and benefits of an enterprise service bus (ESB)? I am looking for information about: the kinds of problems and ESB helps to solve the alternatives to an ...

What is the future of GlassFish ESB / Open ESB [closed]

With the merger of SUN and Oracle: What is the future of Open ESB a.k.a. GlassFish ESB? Is this a product which will be discontinued as Oracle has Oracle Service Bus (was BEA AquaLogic Service Bus)?

What data/service is where?

What management tools (open source or otherwise) are there to track the location of data, the services that deliver/use that data and the services themselves. If you believe the snake oil a ...

热门标签