About Question enthuware.oce-ejbd.v6.2.583 :

Moderator: admin

Post Reply
kdmandawe
Posts: 16
Joined: Sun Aug 04, 2013 9:54 am
Contact:

About Question enthuware.oce-ejbd.v6.2.583 :

Post 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

kezman9
Posts: 26
Joined: Fri Jul 06, 2012 1:08 am
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.583 :

Post 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

kdmandawe
Posts: 16
Joined: Sun Aug 04, 2013 9:54 am
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.583 :

Post 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

kezman9
Posts: 26
Joined: Fri Jul 06, 2012 1:08 am
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.583 :

Post 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

kdmandawe
Posts: 16
Joined: Sun Aug 04, 2013 9:54 am
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.583 :

Post 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.. :lol:

Best regards,
Kenneth

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests