Announcement Announcement Module
Collapse
No announcement yet.
Expression language support for JSON Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Expression language support for JSON

    In Mule 3, I can have a string payload that consists of JSON and I can do expression language operations on it.

    For example,
    Code:
    expression="#[json:job/state]"
    retrieves the job state and uses it for a routing descision.

    In Spring Integration, I have found that the expression language only seems to support java objects,
    e.g.
    Code:
    exchange-name-expression="payload"
    If payload is a string, then I can only to String operations on it.
    The use case I have is that I want to dynamically route messages to a given exchange (in AMQP) based
    on the message contents.

    Is there support for this?

    Obviously in my service, I could convert the JSON string to a Java JSONObject, but then the outbound adapter would have to serialize back.

    Any other ideas would be welcome.

    Earl

  • #2
    Hi Earl,

    Thanks for bringing this up. We certainly need to improve our JSON support to cover your use-case. Consequently I have created a Jira to add support for JsonPath:

    https://jira.springsource.org/browse/INTEXT-29

    My thoughts right now, would be to provide Adapters similar to the XPath support we have, adding JSon specific Routers, Enrichers and Filters. I am not so sure, yet, regarding adding support directly into SpEL.

    Please let us know any additional thoughts you have.

    Cheers,

    Gunnar

    Comment

    Working...
    X