2 Replies Latest reply on Jan 25, 2013 5:54 PM by 975124

    Issue using Message selectors in plugin

    Naveen Rajanna

      I'm facing following issue regarding message selectors in automation plugin. Please help.

      I have 2 automation tasks (A and B). transition (task A -> task B )

      1. uses XML Body for co-rrelation (same logic for both tasks).
      2. have an Xquery sender and automator (External).
      3. These External automator of both tasks are referring to a single response queue.

      Since both of MDB are referring to same response queue. I wanted to use message selector to identify and select correct response based on some soap jms property.

      For Task A, I have specified message selector with soap jms property (say V1), Task B (V2)

      Positive: If I post response having soap jms property V1. It gets consumed in Task A and moves to Task B waiting for response (V2). This is working.
      When order is in Task A (waiting for response V1) if I post response of Task B (V2). It should give a automation Exception as in plugin message selector has value V1.

      But this is not what I experienced. Instead it is completing the task successfully.

      Is it feasible to use message selectors for 2 plugins having same correleation logic and pointing to same response queue??
      Please let me know if there is any other way I can achieve the above mentioned.

        • 1. Re: Issue using Message selectors in plugin
          Hi Naveen;

          Can you clarify the following please?

          1. Look at Design Studio->Preferences->Oracle Design Studio->Order and Service Management preference screen. Is the value for "Automation plug-in Build And Deploy Mode" set to "Optimized"? (This is available on 7.0.3 and later). It's fine if it is, and I'm assuming that's the case, just need to understand this setting as it affects how external messages are routed to plugins.
          2. What is the correlation logic for A and B. Is it correlating on the same value? Most likely it is.

          The reason why these two questions are pertinent, is that with Optimized build-and-deploy mode, we now have the ability to have multiple plugins listen on the same queue without requiring special selectors in order to discriminate/route messages to the correct plugins. Prior to 7.0.3 (or if you have chosen to use legacy mode), then selectors were absolutely required to be used if you had multiple plugins listening on the same queue. This was because there was a 1:1 relationship between the MDB that OSM generates for the external receiver plugin, and the business logic (XSLT, XQuery or Java automator) that gets executed when we receive a message on that JMS destination and correlate it to the task. With legacy mode, if you have two automated tasks with external receivers listening on the same queue that don't have selectors that uniquely select/route messages to one task or the other, then the MDBs listening on that queue are both eligible to receive the message and it will be non-deterministic as to which one receives it at any given moment. As a result, with legacy mode you have no choice but to use selectors to ensure messages arriving on the same queue are routed to the right plugin.

          With Optimized mode, we simplified that. External receiver plugins deployed in optimized mode that are listening on the same queue do not require selectors to discriminate/route messages to one task or another. OSM will automatically route the message to the right task based on correlation information extracted from the incoming message.

          You can verify this by switching to legacy mode and see if that resolves your problem. I would caution you though against just relying on using legacy mode and instead you should consider a different approach that ensures correlation id's are used properly. The rule on correlation id's is that they are unique in the system (i.e. only point to one task) at a given point in time. Since an external message arrives with a valid correlation id for Task A, it will get routed to Task A. If you don't want this to be the case, then choose a different correlation vale for A and B. Or alternatively, have A receive the message and functionally reject it since it was sent out of order anyway.


          1 person found this helpful
          • 2. Re: Issue using Message selectors in plugin
            Sorry I posted wrong content.

            Edited by: tarini.samal on Jan 25, 2013 9:53 AM