Layer7 API Management

Expand all | Collapse all

JMS message selectors?

Jump to Best Answer
  • 1.  JMS message selectors?

    Posted 08-23-2016 09:56 AM

    Hi

    Can Layer7 consume JMS messages based on a message selector? I would like to consume messages based on their JMS timestamp so that they don't get consumed too early.

     

    Thanks

    Stephan



  • 2.  Re: JMS message selectors?

    Posted 08-30-2016 12:20 AM

    Stephan,

     

    Good evening. When a JMS connection is setup through the Policy manager there are 2 options on how the message is handled either:

    1) "On Take" whereby the message is pulled from the queue and processed through the policy. If for some reason the policy fails then the message is lost.

    2) "On Completion" whereby the message on the JMS queue is flagged that it is being worked on and then the message is processed through the policy. If for some reason the policy fails, the message will remain on the queue and the flag is removed.

     

    For the scenario that is outlined, use the "On Completion" option to ensure that the message is not removed as we processes the properties in the message through the policy. In the policy, the compare assertion can be used to validate the timestamp using the ${request.jms.property.<name>} context variable and then determine what time frame you wish to validate against.

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support



  • 3.  Re: JMS message selectors?

    Posted 08-30-2016 05:05 AM

    Hi Stephen

     

    Either my explanation of the case was not clear enough or I don't understand your answer correctly.

     

    Let's assume that I consume a message with layer7. I check the message headers and the timestamp says that it is too early to process the message. What sould I then do with it? If I raise an error, the message is not commited on the broker. That means it is instantly redelivered and processed again. The broker delivers the messages in the given order. Only message selectors have the ability to selectively consume messages based on conditions. 

     

    Basically I want to have messages "waiting" in the queue until the timestamp says that they can be processed. 

     

    Regards

    Stephan



  • 4.  Re: JMS message selectors?

    Posted 08-31-2016 02:41 AM

    Stephan,

     

    I appreciate the additional information as the scenario I presented as you outlined will continue to pick up the message with no filtering directly on the consumer. I've been digging into if the request for message selector has been made or if there was any internal documentation on this. From review and testing at the moment, the capability of the message selector does not appear to exist in the gateway JMS implementation. I will inquire with our development teams for further information.

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support



  • 5.  Re: JMS message selectors?
    Best Answer

    Posted 09-16-2016 11:48 AM

    Stephan,

     

    The message selector is not currently available and there does not appear a way to implement this. Please open an idea for our product management team to review.

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support