Dynamic messageSelector in Glassfish 2.1

79 views Asked by At

It is possible to have a messageSelector value based on a System property?

I have an MDB:

@ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "notification_channel_id = 'EMAIL' AND instance= 'domain1'")

What I would have is:

@ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "notification_channel_id = 'EMAIL' AND instance= MY_INSTANCE")

where MY_INSTANCE is a system property with value "domain1" or "domain2" ... and so on (depends on domain name)
(System property is set via glassfish JVM-OPTION )

My goal is to let MDB manage only messages whose recipient is the instance MDB belongs to.

Glassfish version is 2.1
thanks,
Sara

EDIT at the moment im'using method onMessage in wich i put if statement to decide whether manage message or not...

EDIT 15/12/14 i changed configuration using sun-ejb-jar.xml file instead of annotation in MDB definition. I can now edit config file but this is still inside .ear file and i have to rebuild/deploy in order to changes makes effect. Is there a way to change this file outside from .ear ?

0

There are 0 answers