Bug 1090012

Summary: Document: Enable property substitution in MDB and EJB via @Resource and @ActivationConfigProperty annotation
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Miroslav Novak <mnovak>
Component: DocumentationAssignee: sgilda
Status: CLOSED CURRENTRELEASE QA Contact: Russell Dickenson <rdickens>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: mnovak, sgilda, smumford
Target Milestone: ER4Keywords: Documentation, FutureFeature, Triaged
Target Release: EAP 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-28 15:39:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1051640    

Description Miroslav Novak 2014-04-22 11:32:57 UTC
Document new feature which enables to set @Resource and values for in ActivationConfigProperty in MDB by a system property.

Like:
...
@ActivationConfigProperty(propertyName = "destination", propertyValue = "${jms.queue.InQueue}")})
...
@Resource(mappedname="${resource.name}")

can be set by specifying system properties -Djms.queue.InQueue=jms/queue/InQueue" and -Dresource.name=CF during start of EAP server or in CLI:
[standalone@localhost:9999 /] /system-property=jms.queue.InQueue:add(value=jms/queue/InQueue)
[standalone@localhost:9999 /] /system-property=resource.name:add(value=CF)

For this to work this functionality must be enabled in ee subsystem by setting attribute "annotation-property-replacement" to true. (Description: Flag indicating whether EJB annotations will have property replacements applied)

Comment 1 sgilda 2014-04-29 19:46:24 UTC
I'll take this one.

Shouldn't this go in the Developer Guide?

Comment 2 sgilda 2014-04-29 19:46:54 UTC
Ignore the above comment. :-)

Comment 3 sgilda 2014-04-29 21:08:34 UTC
On second thought, does this topic belong in the Development Guide under '7.4. Message-Driven Beans'?

Comment 6 sgilda 2014-05-05 23:17:58 UTC
I've been looking at the helloworld-mdb quickstart to create a version that uses property substitution. How do you replace the values in the hornet-queue.xml file?

That quickstart is located here: https://github.com/jboss-developer/jboss-eap-quickstarts/tree/6.3.x-develop/helloworld-mdb

Comment 7 Miroslav Novak 2014-05-06 11:23:16 UTC
AFAIK replacing value for queue name in hornet-queue.xml is out of scope of this RFE. This is just about replacing values in @Resource and @ActivationConfigProperty in MDB/EJB by system properties.

Comment 8 sgilda 2014-05-06 15:56:16 UTC
Created blank topic: Enable Property Substitution in MDB [30840]

Comment 11 Miroslav Novak 2014-05-09 08:02:31 UTC
Good to know that property substitution is working also in hornetq-jms.xml. :-)
Great work!

Comment 12 JBoss JIRA Server 2015-04-28 15:10:05 UTC
John Doyle <jdoyle> updated the status of jira EAP6-38 to Closed

Comment 13 JBoss JIRA Server 2015-04-28 15:10:07 UTC
John Doyle <jdoyle> updated the status of jira EAP6-146 to Closed