如何访问json数据m子esb [英] how to access json data mule esb

查看:134
本文介绍了如何访问json数据m子esb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将同步流生成的json数据访问到异步流中. 我从同步流正确获取json数据,我想从我的json数据中获取某些属性值,如下所示:

i want to access json data generated from the sync flow into an async flow. I am getting json data from sync flow correctly and i want to fetch certain attribute value from that my json data is as follows :

{"data" : [{"in_timestamp":"2012-12-04","message":"hello","out_timestamp":null,"from_user":"user2","ID":43,"to_user":"user1"}]} and to user is #[json:to_user]}

我想从此json格式访问to_user属性. 我尝试使用#[json:to_user],但它只是将其打印为字符串,并且不返回任何值. 请帮忙.预先感谢.

I want to access to_user attribute from this json format. I have tried using #[json:to_user] but it simply prints it as a string and doesnt return any value. Please help. Thanks in advance.

推荐答案

基于示例JSON的正确表达式是:

The right expression based on your sample JSON is:

#[json:data[0]/to_user]

这篇关于如何访问json数据m子esb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆