JMS Message Selector in Mule using date

前端 未结 2 1644
旧巷少年郎
旧巷少年郎 2021-01-28 04:59

In Mule 3.3.1, during async processing, when any of my external services are down, I would like to place the message on a queue (retryQueue) with a particular \"nex

相关标签:
2条回答
  • 2021-01-28 05:15

    The expression in:

    <jms:selector expression="#[header:INBOUND:putOnQueueTime > ((function:now) - 30)]"/>
    

    should evaluate to a valid JMS selector, which is not the case here. Try with:

    <jms:selector expression="putOnQueueTime > #[XXX]"/>
    

    replacing XXX with an expression that creates the time you want.

    0 讨论(0)
  • 2021-01-28 05:23

    We were trying to achieve this in one of the projects I'm working on, and tried what was being suggested in the other answer here, and it did not work, with various variantions. The problem is that the jms:selector doesn't support MEL, since it's relies on ActiveMQ classes.

    We registered a support-ticket to Mulesoft, and their reply was that this is not supported.

    What we ended up doing was this:

    1. Create a simple Component, which does a Thread.sleep(numberOfMillis), where the number of millis is defined in a property.
    2. In the flow that was supposed to delay processing, we added this component as the first step after reading the message from the inbound endpoint.

    Not the best solution ever made, but it works..

    0 讨论(0)
提交回复
热议问题