mule anything studio 第一个应用

发布时间 2023-04-06 09:57:30作者: vx_guanchaoguo0

添加组件 服务组件

  • http listener

  • http listener config

添加 请求组件

  • resquest
  • test.json
[
    {
        "ID": 1,
        "code1": "ER",
        "code2": "38sd",
        "takeOffDate": "2016/03/20",
        "fromAirport": "MUA",
        "price": 400,
        "seatsAvailable": 0,
        "toAirport": "SFO",
        "planeType": "Boeing 737",
        "totalSeats": 150
    },
    {
        "ID": 2,
        "code1": "ER",
        "code2": "45if",
        "takeOffDate": "2016/02/11",
        "fromAirport": "MUA",
        "price": 345.99,
        "seatsAvailable": "LAX",
        "planeType": "Boeing 777",
        "totalSeats": 300
    }
]
  • http resquest config

添加输出组件

  • transform Message

    *输出的json
[
    {
        "ID": 1,
        "code": "ER38sd",
        "price": 400,
        "departureDate": "2016/03/20",
        "origin": "MUA",
        "destination": "SFO",
        "emptySeats": 0,
        "plane": {
            "type": "Boeing 737",
            "totalSeats": 150
        }
    },
    {
        "ID": 2,
        "code": "ER45if",
        "price": 345.99,
        "departureDate": "2016/02/11",
        "origin": "MUA",
        "destination": "LAX",
        "emptySeats": 52,
        "plane": {
            "type": "Boeing 777",
            "totalSeats": 300
        }
    }
]

全部组件

启动模拟服务

python -m http.server  8081