Message selector in JMS Adapter Behavior
TarakNov 3 2012 — edited Feb 26 2020Hi All,
I am in a process implementing Message selector in my project so i did some test to figure out the behavior. It would be appreciate if some on provide me there views on this.
Let me explain my process and why i am going for this.
In my project i have multiple JMS AQ topics. And SOA Publishing and consuming message from the topic based on the standard XSD. Now when i publish message on to the topic in this case either target system consumes it or some of my SOA service listening to this topics and picks the message as soon it has an entry in the topic . I am consume the records using durable subscriber. Now why i am going with Message selector is based on the value in the xml getting from Topic i will decide to go with business logic or not for that interface. Suppose i will look for value in the xml, if it is there i will get into this logic else my switch terminates.
I understand from the oracle documentation using message selector i can't validate the value in the body. I can use only the properties values to filter the message.
Now coming to my experiment on this.
I create two composites one to publish and other to consume. Composite one publish it on Topic1 and Composite 2 consume the message from topic1. Now i set JMSPriority=3 in composite 1 and published on topic and in composite2 i given as *<property name="MessageSelector" value="JMSPriority='3'"/>*.
Now when i publish the message on topic1, Immediately my composite2 consumes the message and i verified it and came to know that it is picking messages with priority 3 only.
Now i changes the *<property name="MessageSelector" value="JMSPriority='4'"/>* and redeployed the process and publish the message on to the topic. This time it didn't pick the message as expected.
Now i redeployed the service again by changing the *<property name="MessageSelector" value="JMSPriority='3"/>* .
I am expecting that the earlier message which i publish with priority 3 should be picked now. But it didn't picked, but if i go with one more test and publish the message on to the topic 1 with priorty 3 then my consposite2 immediately getting the message.(*Please note that my durable subscriber remains the same in all the cases*)
From above test what i came to know is if i publish message on to the topic with priority 3 at that point of time if my message selector is not to set "JMSPriority='3" then i never can consume this message again even i redeploy with same priority or even i change the priority in EM console of composite2.
Can some one let me know what i came to know with above test is true or not. Or do i am missing some concept to under this behavior???
Regards,
Tarak.