From 147412207e7eefea139c74726530a51d91ee6b65 Mon Sep 17 00:00:00 2001 From: Bryan Kowal Date: Tue, 3 Sep 2013 13:46:19 -0500 Subject: [PATCH] Issue #2163 - RHEL6 14.1.1 build updates Former-commit-id: 861a88708412a30e6849d2ba113089ee909a2093 [formerly 17d652a8ddd752a14769a9916e9dd3c883cb2f66] [formerly 9415560b386f2296212c2cf75df0a6cd94ea51f5] [formerly 861a88708412a30e6849d2ba113089ee909a2093 [formerly 17d652a8ddd752a14769a9916e9dd3c883cb2f66] [formerly 9415560b386f2296212c2cf75df0a6cd94ea51f5] [formerly ab3485a3ed30b7b46bbb1c1bc4355fe41bde1769 [formerly 9415560b386f2296212c2cf75df0a6cd94ea51f5 [formerly b0e47f4548c235a7cbaefc12e97264ce4c782fce]]]] Former-commit-id: ab3485a3ed30b7b46bbb1c1bc4355fe41bde1769 Former-commit-id: ece1f596c634982bc5c188a4f87909c0a376b46f [formerly 751f005228eaf850c6c114683967d87280d589d6] [formerly dbc6b10841e1b6bd48ab2c5bb58813c728e5fbb6 [formerly 17b8ded08275356b560d188ef5baea46037b5784]] Former-commit-id: 5eac7e9d81479e0f95630179883986d57bbb753f [formerly 6de01af6746e96d5fddd4ec3ed69753fa71a0eaf] Former-commit-id: a8898ec348133a8165a00b833446012c0201c04b --- .../feature.xml | 36 ++++++------- .../feature.xml | 46 +++++++--------- .../uf/edex/distribution/DistributionSrv.java | 19 +++++-- nativeLib/edexBridge/edexBridge.cpp | 52 ++++++++++++++++--- .../datadelivery.patch0 | 24 +++------ rpms/build/x86_64/build.sh | 13 ++--- .../Installer.jimporter/component.spec | 8 ++- 7 files changed, 120 insertions(+), 78 deletions(-) diff --git a/cave/com.raytheon.uf.viz.feature.alertviz/feature.xml b/cave/com.raytheon.uf.viz.feature.alertviz/feature.xml index 435f916555..5cc16c3667 100644 --- a/cave/com.raytheon.uf.viz.feature.alertviz/feature.xml +++ b/cave/com.raytheon.uf.viz.feature.alertviz/feature.xml @@ -42,24 +42,6 @@ - - - - - - + + + + + + diff --git a/edexOsgi/com.raytheon.uf.common.base.feature/feature.xml b/edexOsgi/com.raytheon.uf.common.base.feature/feature.xml index eda6adfddc..784aa537bb 100644 --- a/edexOsgi/com.raytheon.uf.common.base.feature/feature.xml +++ b/edexOsgi/com.raytheon.uf.common.base.feature/feature.xml @@ -29,32 +29,6 @@ install-size="0" version="0.0.0"/> - - - - - - - - + + + + + + * @@ -73,6 +74,10 @@ public class DistributionSrv { private static final IUFStatusHandler statusHandler = UFStatus .getHandler(DistributionSrv.class); + private static final String HEADER_QPID_SUBJECT = "qpid.subject"; + + private static final String MESSAGE_HEADER = "header"; + private static class PatternWrapper { private final String plugin; @@ -223,7 +228,15 @@ public class DistributionSrv { StringBuilder pluginNames = new StringBuilder(); List dest = new ArrayList(); Message in = exchange.getIn(); - String header = (String) in.getHeader("header"); + // determine if the header is in the qpid subject field? + String header = (String) in.getHeader(HEADER_QPID_SUBJECT); + if (header != null) { + // make the qpid subject the header so that everything downstream + // will be able to read it as the header. + in.setHeader(MESSAGE_HEADER, header); + } + + header = (String) in.getHeader(MESSAGE_HEADER); Object payload = in.getBody(); String bodyString = null; if (payload instanceof byte[]) { @@ -277,8 +290,8 @@ public class DistributionSrv { throws DistributionException { RequestPatterns patternSet = null; try { - patternSet = SerializationUtil - .jaxbUnmarshalFromXmlFile(RequestPatterns.class, modelFile.getPath()); + patternSet = SerializationUtil.jaxbUnmarshalFromXmlFile( + RequestPatterns.class, modelFile.getPath()); } catch (Exception e) { throw new DistributionException("File " + modelFile.getAbsolutePath() diff --git a/nativeLib/edexBridge/edexBridge.cpp b/nativeLib/edexBridge/edexBridge.cpp index 0cb17d9179..27fb19a6e8 100644 --- a/nativeLib/edexBridge/edexBridge.cpp +++ b/nativeLib/edexBridge/edexBridge.cpp @@ -97,9 +97,9 @@ public: uint64_t current = (((long long) tv.tv_sec) * 1000000 + ((long long) tv.tv_usec)) / 1000; message.setDurable(true); + message.setSubject(fileHeader); message.setContent(fileLocation); - message.getProperties()["header"] = fileHeader; - message.getProperties()["enqueueTime"] = current; + message.setProperty("enqueueTime", current); this->sender.send(message); @@ -122,12 +122,44 @@ private: unotice ("Cleaning up"); // Destroy resources. - try { - session.close(); - connection.close(); - } catch (const std::exception& error) { - this->isConnected = false; - } + if (this->sender != 0) + { + try + { + this->sender.close(); + this->sender = 0; + } + catch (const std::exception& error) + { + uwarn(error.what()); + } + } + + if (this->session != 0) + { + try + { + this->session.close(); + this->session = 0; + } + catch (const std::exception& error) + { + uwarn(error.what()); + } + } + + if (this->connection != 0) + { + try + { + this->connection.close(); + this->connection = 0; + } + catch (const std::exception& error) + { + uwarn(error.what()); + } + } this->isConnected = false; } @@ -136,6 +168,10 @@ private: return this->isConnected; } try { + this->connection = 0; + this->session = 0; + this->sender = 0; + std::stringstream qpidURLBuilder; qpidURLBuilder << "amqp:tcp:"; qpidURLBuilder << this->brokerURI; diff --git a/rpms/awips2.edex/Installer.edex-datadelivery/datadelivery.patch0 b/rpms/awips2.edex/Installer.edex-datadelivery/datadelivery.patch0 index 1c140e92ae..d5602388dd 100644 --- a/rpms/awips2.edex/Installer.edex-datadelivery/datadelivery.patch0 +++ b/rpms/awips2.edex/Installer.edex-datadelivery/datadelivery.patch0 @@ -1,13 +1,8 @@ diff -crB a/component.spec b/component.spec -*** a/component.spec 2013-08-07 10:24:32.038932868 -0500 ---- b/component.spec 2013-08-07 10:24:18.422990138 -0500 +*** a/component.spec 2013-09-03 10:51:59.952913214 -0500 +--- b/component.spec 2013-09-03 11:10:40.703226553 -0500 *************** -*** 1,13 **** - # -! # AWIPS II Edex "component" spec file - # - %define __prelink_undo_cmd %{nil} - # Turn off the brp-python-bytecompile script +*** 6,13 **** %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g') @@ -16,12 +11,7 @@ diff -crB a/component.spec b/component.spec Version: %{_component_version} Release: %{_component_release} Group: AWIPSII ---- 1,13 ---- - # -! # AWIPS II Edex Data Delivery spec file - # - %define __prelink_undo_cmd %{nil} - # Turn off the brp-python-bytecompile script +--- 6,13 ---- %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g') @@ -65,7 +55,7 @@ diff -crB a/component.spec b/component.spec %postun %clean ---- 47,100 ---- +--- 47,104 ---- if [ $? -ne 0 ]; then exit 1 fi @@ -120,14 +110,16 @@ diff -crB a/component.spec b/component.spec + exit 1 + fi + fi ++ %postun %clean *************** *** 67,69 **** ---- 105,109 ---- +--- 109,113 ---- %dir /awips2 %dir /awips2/edex /awips2/edex/* + + %attr(744,root,root) /etc/init.d/* +\ No newline at end of file diff --git a/rpms/build/x86_64/build.sh b/rpms/build/x86_64/build.sh index 604e39de12..2df945f800 100644 --- a/rpms/build/x86_64/build.sh +++ b/rpms/build/x86_64/build.sh @@ -124,11 +124,18 @@ fi if [ "${1}" = "-rh6" ]; then buildRPM "awips2-common-base" + buildEDEX + if [ $? -ne 0 ]; then + exit 1 + fi + buildRPM "awips2-hydroapps-shared" + buildRPM "awips2-notification" buildJava buildRPM "awips2-python" buildRPM "awips2-python-cherrypy" buildRPM "awips2-python-nose" buildRPM "awips2-python-pil" + buildRPM "awips2-python-jimporter" buildRPM "awips2-python-qpid" buildRPM "awips2-python-thrift" buildRPM "awips2-python-werkzeug" @@ -185,12 +192,6 @@ if [ "${1}" = "-rh6" ]; then buildRPM "awips2-data.hdf5-topo" buildRPM "awips2" buildOpenfire - buildEDEX - if [ $? -ne 0 ]; then - exit 1 - fi - buildRPM "awips2-hydroapps-shared" - buildRPM "awips2-notification" exit 0 fi diff --git a/rpms/python.site-packages/Installer.jimporter/component.spec b/rpms/python.site-packages/Installer.jimporter/component.spec index e982abb9ab..a8e159eb9b 100644 --- a/rpms/python.site-packages/Installer.jimporter/component.spec +++ b/rpms/python.site-packages/Installer.jimporter/component.spec @@ -35,15 +35,21 @@ then fi rm -rf %{_build_root} -mkdir -p %{_build_root}/awips2/python/lib/python2.7/site-packages %build %install +mkdir -p %{_build_root}/awips2/python/lib/python2.7/site-packages +if [ $? -ne 0 ]; then + exit 1 +fi JIMPORTER_SRC_DIR="%{_python_pkgs_dir}/java-importer" cp -rv ${JIMPORTER_SRC_DIR}/* \ %{_build_root}/awips2/python/lib/python2.7/site-packages +if [ $? -ne 0 ]; then + exit 1 +fi %pre