-
1. Re: Add emails and groups of emails to DTGov
giorgimode Nov 26, 2014 5:49 AM (in response to giorgimode)1 of 1 people found this helpfulI found the problem. In org.overlord.sramp.governance.Governance, the output is wrong:
public static String NOTIFICATION_ERROR = GovernanceConstants.GOVERNANCE + ".<email|..> should be of the format <groupName>|<fromAddress>|<destination1>,<destination2>\nCheck\n";
I checked org.overlord.sramp.governance.NotificationDestinations and it should be <groupName>|<fromAddress>|<destination1>::<destination2>
I tested <property name="governance.email" value="docMgr|overlord@mycompany.com|sampleEmail@gmail.com::sample@gmail.com"/>
works fine. Also documentation needs to be updated, so that two colons are used, not one.
As for CLI, it is related to this bug: https://bugzilla.redhat.com/show_bug.cgi?id=1153831
The bug is specific not only to FSW, but also to EAP.
-
2. Re: Add emails and groups of emails to DTGov
giorgimode Dec 1, 2014 8:33 AM (in response to giorgimode)As I already mentioned, adding this to EAP standalone.xml is working
<property name="governance.email" value="docMgr|overlord@mycompany.com|sampleEmail@gmail.com::sample@gmail.com"/>
But I still have not figured out what to do in case of several email groups. I tried adding this as well
<property name="governance.email" value="stageMgr|overlord@mycompany.com|sampleEmail@gmail.com::sample@gmail.com"/>
This issues error, since governance.email property cannot be defined twice in EAP configuration.xml.
Any help would be much appreciated.
-
3. Re: Add emails and groups of emails to DTGov
eric.wittmann Dec 1, 2014 9:36 AM (in response to giorgimode)After looking briefly at the code on the master branch, I believe there is a bug in this capability when using standalone.xml as the source of dtgov configuration properties. The standalone.xml approach does not support multiple properties with the same name (as you've observed). If you use dtgov.properties instead of standalone.xml, you *can* in fact use multiple properties with the same name. When we implemented the config support in standalone.xml we apparently forgot (didn't realize) that the email notification system required multiple properties with the same name.
The offending code is here:
This could be fixed easily by changing the standalone.xml config support to be a Map<String, List<String>> instead of Map<String, String>. The above code reads the values in standalone.xml and then binds the result to JNDI, where it is later look it up here:
Looking at the implementation of MapConfiguration in apache commons, it seems to already handle Maps of Lists - so nothing should need to change here.
Note: a possible workaround that does not require any code changes, after looking at the MapConfiguration code, is to try this:
<property name="governance.email" value="docMgr|overlord@mycompany.com|sampleEmail@gmail.com::sample@gmail.com,stageMgr|overlord@mycompany.com|sampleEmail@gmail.com::sample@gmail.com"/>
The MapConfiguration class seems to automatically support comma-separated values, unless list parsing is explicitly disabled (which I don't think is happening in overlord). Obviously supporting multiple values in standalone.xml is a better solution, but the above might work today.
-
4. Re: Add emails and groups of emails to DTGov
giorgimode Dec 2, 2014 6:47 AM (in response to eric.wittmann)I just tested the workaround that you suggested and it works like a charm. I am unable to edit the code now, since overlord is up and running already. Later I may test it with jboss overlay.
For now, workaround is great. Thanks a lot.