-
MQ_QUEUES
— comma delimited list of queue names -
MQ_TOPICS
— comma delimited list of topic names
Last active
September 22, 2016 07:54
-
-
Save goldmann/905413495e520590f7d944868712630c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def configure_mq_destinations(self): | |
queues = os.getenv("MQ_QUEUES", "").split(',') | |
topics = os.getenv("MQ_TOPICS", "").split(',') | |
destinations = Template(self.get_resource("queues-xml.jinja")) | |
mq_snippet = destinations.render(queues=queues, topcis=topics) | |
self.logger.debug(mq_snippet) | |
xml = XMLEdit("os-eap7-openshift/added/standalone-openshift.xml") | |
xml.add_element("/ns:server/ns:management/ns:security-realms", mq_snippet) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for queue in queues %} | |
<jms-queue name="{{ queue }}" entries="/queue/{{ queue }}"/> | |
{% endfor %} | |
{% for topic in topics %} | |
<jms-topic name="{{ topic }}" entries="/topic/{{ topic }}"/> | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function configure_mq_destinations() { | |
IFS=',' read -a queues <<< ${MQ_QUEUES} | |
IFS=',' read -a topics <<< ${MQ_TOPICS} | |
destinations="" | |
if [ "${#queues[@]}" -ne "0" -o "${#topics[@]}" -ne "0" ]; then | |
if [ "${#queues[@]}" -ne "0" ]; then | |
for queue in ${queues[@]}; do | |
destinations="${destinations}<jms-queue name=\"${queue}\" entries=\"/queue/${queue}\"/>" | |
done | |
fi | |
if [ "${#topics[@]}" -ne "0" ]; then | |
for topic in ${topics[@]}; do | |
destinations="${destinations}<jms-topic name=\"${topic}\" entries=\"/topic/${topic}\"/>" | |
done | |
fi | |
fi | |
echo "${destinations}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment