Page 1 of 1
About Question enthuware.oce-ejbd.v6.2.583 :
Posted: Tue Aug 13, 2013 4:33 am
by kdmandawe
Hi,
The Application Assembler may further restrict, but not replace, the value of the messageSelectorproperty of a JMS message-driven bean.
Could you kindly elaborate this? The way I understand it, 'May further restrict' means it doesn't override what's already specified by the Bean Provider, it just restricts it further, is that right? What will happen if you will take out some of the restrictions(lesser degree instead of 'further restricting')?
If possible, kindly provide sample code snippets.
Thanks in advance!
Kenneth
Re: About Question enthuware.oce-ejbd.v6.2.583 :
Posted: Tue Aug 13, 2013 6:15 am
by kezman9
let's say that selector is like this:
colour = 'blue'
App Assembler car further restrict selector for example to:
colour = 'blue' and age = 10
It cannot go the opposite way, which means assembler cannot delete the restriction about the colour in this example
HTH,
J
Re: About Question enthuware.oce-ejbd.v6.2.583 :
Posted: Tue Aug 13, 2013 9:20 am
by kdmandawe
kezman9 wrote:let's say that selector is like this:
colour = 'blue'
App Assembler car further restrict selector for example to:
colour = 'blue' and age = 10
It cannot go the opposite way, which means assembler cannot delete the restriction about the colour in this example
HTH,
J
Hi J,
Thanks a lot for that concrete example. Just a follow-up question to that, in your example above, how about if the App Assembler only specified
age = 10
, what will be the resulting selector?
Regards,
Kenneth
Re: About Question enthuware.oce-ejbd.v6.2.583 :
Posted: Tue Aug 13, 2013 10:38 am
by kezman9
Hi Kenneth,
I had similar problem at my work when I wanted to dynamically change message selector at runtime (in annotation). Unfortunately it's impossible. Values provided in annotations must be well defined at compile time and deployment descriptor is processed by container during application deployment. But getting back to example I expected to get some deployment error or at least warning in Glassfish log file but it didn't happen. Also when I sent message to queue with different msg selectors, the MDB didn't consume them. The selectors I tried was colour = blue and age = 10. Generally you should expect some vendor specific message from container during app deployment. But as you see, it's not always the case. The correct behaviour isn't specified in this scenario, so the containers are free to implement it in their way (or not implement at all as life shows sometimes). There is also bright side of this:
it's 100% (ok, 99,9999999%) you won't get question like "what happen if app assembler takes out some restrictions on selectors"

It would be rather "can app assembler further restrict message selector value"?
Thanks,
J
Re: About Question enthuware.oce-ejbd.v6.2.583 :
Posted: Wed Aug 14, 2013 6:36 am
by kdmandawe
Thanks for the assurance J! I'm getting excited to take the real exam. If I'll get one question like that though, I'm gonna chase you back..
Best regards,
Kenneth